Page Contents
Home > @loopback/repository > EntityCrudRepository > save
EntityCrudRepository.save() method
Save an entity. If no id is present, create a new entity
Signature:
save(entity: DataObject<T>, options?: Options): Promise<T>;
Parameters
Parameter | Type | Description |
---|---|---|
entity | DataObject<T> | Entity to be saved |
options | Options | Options for the operations |
Returns:
Promise<T>
A promise that will be resolve if the operation succeeded or will be rejected if the entity was not found.