Connection used by this entity manager.
Plain to object transformer used in create and merge operations.
Custom query runner to be used for operations in this entity manager. Used only in non-global entity manager.
Once created and then reused by en repositories.
Clears all the data from the given table (truncates/drops it).
Note: this method uses TRUNCATE and may not work as you expect in transactions on some platforms.
Counts entities that match given options. Useful for pagination.
Counts entities that match given conditions. Useful for pagination.
Creates a new entity instance.
Creates a new entity instance and copies all entity properties from this object into a new entity. Note that it copies only properties that present in entity schema.
Creates a new entities and copies all entity properties from given objects into their new entities. Note that it copies only properties that present in entity schema.
Creates a new query builder that can be used to build a sql query.
Creates a new query builder that can be used to build a sql query.
Decrements some column by provided value of the entities matched given conditions.
Deletes entities by a given condition(s). Unlike save method executes a primitive operation without cascades, relations and other operations included. Executes fast and efficient DELETE query. Does not check if entity exist in the database. Condition(s) cannot be empty.
Finds entities that match given options.
Finds entities that match given conditions.
Finds entities that match given find options. Also counts all entities that match given conditions, but ignores pagination settings (from and take options).
Finds entities that match given conditions. Also counts all entities that match given conditions, but ignores pagination settings (from and take options).
Finds entities with ids. Optionally find options can be applied.
Finds entities with ids. Optionally conditions can be applied.
Finds first entity that matches given find options.
Finds first entity that matches given find options.
Finds first entity that matches given conditions.
Finds first entity that matches given find options or rejects the returned promise on error.
Finds first entity that matches given find options or rejects the returned promise on error.
Finds first entity that matches given conditions or rejects the returned promise on error.
Gets custom entity repository marked with @EntityRepository decorator.
Gets entity mixed id.
Gets entity mixed id.
Gets mongodb repository for the given entity class.
Gets repository for the given entity class or name. If single database connection mode is used, then repository is obtained from the repository aggregator, where each repository is individually created for this entity manager. When single database connection is not used, repository is being obtained from the connection.
Gets tree repository for the given entity class or name. If single database connection mode is used, then repository is obtained from the repository aggregator, where each repository is individually created for this entity manager. When single database connection is not used, repository is being obtained from the connection.
Checks if entity has an id.
Checks if entity of given schema name has an id.
Increments some column by provided value of the entities matched given conditions.
Inserts a given entity into the database. Unlike save method executes a primitive operation without cascades, relations and other operations included. Executes fast and efficient INSERT query. Does not check if entity exist in the database, so query will fail if duplicate entity is being inserted. You can execute bulk inserts using this method.
Merges two entities into one new entity.
Creates a new entity from the given plan javascript object. If entity already exist in the database, then it loads it (and everything related to it), replaces all values with the new ones from the given object and returns this new entity. This new entity is actually a loaded from the db entity with all properties replaced from the new object.
Executes raw SQL query and returns raw database results.
Releases all resources used by entity manager. This is used when entity manager is created with a single query runner, and this single query runner needs to be released after job with entity manager is done.
Removes a given entity from the database.
Removes a given entity from the database.
Removes a given entity from the database.
Removes a given entity from the database.
Saves all given entities in the database. If entities do not exist in the database then inserts, otherwise updates.
Saves all given entities in the database. If entities do not exist in the database then inserts, otherwise updates.
Saves all given entities in the database. If entities do not exist in the database then inserts, otherwise updates.
Saves all given entities in the database. If entities do not exist in the database then inserts, otherwise updates.
Wraps given function execution (and all operations made there) in a transaction. All database operations must be executed using provided entity manager.
Updates entity partially. Entity can be found by a given condition(s). Unlike save method executes a primitive operation without cascades, relations and other operations included. Executes fast and efficient UPDATE query. Does not check if entity exist in the database. Condition(s) cannot be empty.
Generated using TypeDoc
Entity manager supposed to work with any entity, automatically find its repository and call its methods, whatever entity type are you passing.