Connection used by this entity manager.
Plain to object transformer used in create and merge operations.
Once created and then reused by en repositories.
Gets query runner used to execute queries.
Execute an aggregation framework pipeline against the collection.
Execute an aggregation framework pipeline against the collection. This returns modified version of cursor that transforms each result into Entity model.
Overrides cursor's toArray and next methods to convert results to entity automatically.
Perform a bulkWrite operation without a fluent API.
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.
Retrieve all the indexes on the collection.
Retrieves this collections index info.
Retrieve all the indexes on the collection.
Converts FindManyOptions to mongodb query.
Converts FindOneOptions to mongodb query.
Converts FindOptions into mongodb order by criteria.
Ensures given id is an id for query.
Count number of matching documents in the db to a query.
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 an index on the db and collection.
Creates multiple indexes in the collection, this method is only supported for MongoDB 2.6 or higher. Earlier version of MongoDB will throw a command not supported error. Index specifications are defined at http://docs.mongodb.org/manual/reference/command/createIndexes/.
Creates a cursor for a query that can be used to iterate over results from MongoDB.
Creates a cursor for a query that can be used to iterate over results from MongoDB. This returns modified version of cursor that transforms each result into Entity model.
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 conditions. 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.
Delete multiple documents on MongoDB.
Delete a document on MongoDB.
The distinct command returns returns a list of distinct values for the given key across a collection.
Drops an index from this collection.
Drops all indexes from the collection.
Finds entities that match given find options or conditions.
Finds entities that match given find options or conditions. Also counts all entities that match given conditions, but ignores pagination settings (from and take options).
Finds entities by ids. Optionally find options can be applied.
Finds first entity that matches given conditions and/or find options.
Find a document and delete it in one atomic operation, requires a write lock for the duration of the operation.
Find a document and replace it in one atomic operation, requires a write lock for the duration of the operation.
Find a document and update it in one atomic operation, requires a write lock for the duration of the operation.
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.
Execute a geo search using a geo haystack index on a collection.
Execute the geoNear command to search for items in the collection.
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.
Run a group command across a collection.
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.
Initiate an In order bulk write operation, operations will be serially executed in the order they are added, creating a new operation for each switch in types.
Initiate a Out of order batch write operation. All operations will be buffered into insert/update/remove commands executed out of order.
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.
Inserts an array of documents into MongoDB.
Inserts a single document into MongoDB.
Returns if the collection is a capped collection.
Get the list of all indexes information for the collection.
Run Map Reduce across a collection. Be aware that the inline option for out will return an array of results not a collection.
Merges two entities into one new entity.
Return N number of parallel cursors for a collection allowing parallel reading of entire collection. There are no ordering guarantees for returned results.
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.
Reindex all indexes on the collection Warning: reIndex is a blocking operation (indexes are rebuilt in the foreground) and will be slow for large collections.
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.
Reindex all indexes on the collection Warning: reIndex is a blocking operation (indexes are rebuilt in the foreground) and will be slow for large collections.
Replace a document on MongoDB.
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.
Get all the collection statistics.
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 conditions. 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.
Update multiple documents on MongoDB.
Update a single document on MongoDB.
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.
This implementation is used for MongoDB driver which has some specifics in its EntityManager.