Repository navigation
@142vip.nest typeorm.类.MongoEntityManager
API 参考 / @142vip/nest-typeorm / MongoEntityManager
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/MongoEntityManager.d.ts:23
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.
new MongoEntityManager(
connection):MongoEntityManager
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/MongoEntityManager.d.ts:26
MongoEntityManager
readonly@instanceof:symbol
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/MongoEntityManager.d.ts:24
readonlyconnection:DataSource
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/EntityManager.d.ts:35
Connection used by this entity manager.
protectedplainObjectToEntityTransformer:PlainObjectToNewEntityTransformer
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/EntityManager.d.ts:53
Plain to object transformer used in create and merge operations.
EntityManager.plainObjectToEntityTransformer
readonlyoptionalqueryRunner?:QueryRunner
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/EntityManager.d.ts:40
Custom query runner to be used for operations in this entity manager. Used only in non-global entity manager.
protectedrepositories:Map<EntityTarget<any>,Repository<any>>
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/EntityManager.d.ts:45
Once created and then reused by repositories. Created as a future replacement for the #repositories to provide a bit more perf optimization.
protectedtreeRepositories:TreeRepository<any>[]
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/EntityManager.d.ts:49
Once created and then reused by repositories.
EntityManager.treeRepositories
get mongoQueryRunner():
MongoQueryRunner
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/MongoEntityManager.d.ts:25
MongoQueryRunner
aggregate<
Entity,R>(entityClassOrName,pipeline,options?):AggregationCursor<R>
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/MongoEntityManager.d.ts:107
Execute an aggregation framework pipeline against the collection.
Entity
R = any
EntityTarget<Entity>
Document[]
aggregateEntity<
Entity>(entityClassOrName,pipeline,options?):AggregationCursor<Entity>
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/MongoEntityManager.d.ts:112
Execute an aggregation framework pipeline against the collection. This returns modified version of cursor that transforms each result into Entity model.
Entity
EntityTarget<Entity>
Document[]
AggregationCursor<Entity>
protectedapplyEntityTransformationToCursor<Entity>(metadata,cursor):void
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/MongoEntityManager.d.ts:251
Overrides cursor's toArray and next methods to convert results to entity automatically.
Entity extends ObjectLiteral
FindCursor<Entity> | AggregationCursor<Entity>
void
average<
Entity>(entityClass,columnName,where?):Promise<number|null>
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/EntityManager.d.ts:288
Return the AVG of a column
Entity extends ObjectLiteral
EntityTarget<Entity>
PickKeysByType<Entity, number>
FindOptionsWhere<Entity> | FindOptionsWhere<Entity>[]
Promise<number | null>
bulkWrite<
Entity>(entityClassOrName,operations,options?):Promise<BulkWriteResult>
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/MongoEntityManager.d.ts:116
Perform a bulkWrite operation without a fluent API.
Entity
EntityTarget<Entity>
AnyBulkWriteOperation<Document>[]
Promise<BulkWriteResult>
clear<
Entity>(entityClass):Promise<void>
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/EntityManager.d.ts:366
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.
Entity
EntityTarget<Entity>
Promise<void>
https://stackoverflow.com/a/5972738/925151
collectionIndexes<
Entity>(entityClassOrName):Promise<Document>
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/MongoEntityManager.d.ts:174
Retrieve all the indexes on the collection.
Entity
EntityTarget<Entity>
Promise<Document>
collectionIndexExists<
Entity>(entityClassOrName,indexes):Promise<boolean>
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/MongoEntityManager.d.ts:178
Retrieve all the indexes on the collection.
Entity
EntityTarget<Entity>
string | string[]
Promise<boolean>
collectionIndexInformation<
Entity>(entityClassOrName,options?):Promise<any>
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/MongoEntityManager.d.ts:182
Retrieves this collections index info.
Entity
EntityTarget<Entity>
Promise<any>
protectedconvertFindManyOptionsOrConditionsToMongodbQuery<Entity>(optionsOrConditions):ObjectLiteral|undefined
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/MongoEntityManager.d.ts:231
Converts FindManyOptions to mongodb query.
Entity
any[] | MongoFindManyOptions<Entity> | Partial<Entity> | FilterOperators<Entity> | undefined
ObjectLiteral | undefined
protectedconvertFindOneOptionsOrConditionsToMongodbQuery<Entity>(optionsOrConditions):ObjectLiteral|undefined
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/MongoEntityManager.d.ts:235
Converts FindOneOptions to mongodb query.
Entity
MongoFindOneOptions<Entity> | Partial<Entity> | undefined
ObjectLiteral | undefined
protectedconvertFindOptionsOrderToOrderCriteria(order):ObjectLiteral
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/MongoEntityManager.d.ts:239
Converts FindOptions into mongodb order by criteria.
protectedconvertFindOptionsSelectToProjectCriteria(selects):any
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/MongoEntityManager.d.ts:243
Converts FindOptions into mongodb select by criteria.
FindOptionsSelect<any> | FindOptionsSelectByString<any>
any
protectedconvertMixedCriteria(metadata,idMap):ObjectLiteral
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/MongoEntityManager.d.ts:247
Ensures given id is an id for query.
any
count<
Entity>(entityClassOrName,query?,options?):Promise<number>
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/MongoEntityManager.d.ts:120
Count number of matching documents in the db to a query.
Entity
EntityTarget<Entity>
Promise<number>
countBy<
Entity>(entityClassOrName,query?,options?):Promise<number>
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/MongoEntityManager.d.ts:128
Count number of matching documents in the db to a query.
Entity
EntityTarget<Entity>
Promise<number>
countDocuments<
Entity>(entityClassOrName,query?,options?):Promise<number>
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/MongoEntityManager.d.ts:124
Count number of matching documents in the db to a query.
Entity
EntityTarget<Entity>
Promise<number>
create<
Entity,EntityLike>(entityClass,plainObject?):Entity
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/EntityManager.d.ts:107
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.
Entity
EntityLike
EntityTarget<Entity>
EntityLike
Entity
create<
Entity,EntityLike>(entityClass,plainObjects?):Entity[]
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/EntityManager.d.ts:112
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.
Entity
EntityLike
EntityTarget<Entity>
EntityLike[]
Entity[]
createCollectionIndex<
Entity>(entityClassOrName,fieldOrSpec,options?):Promise<string>
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/MongoEntityManager.d.ts:132
Creates an index on the db and collection.
Entity
EntityTarget<Entity>
Promise<string>
createCollectionIndexes<
Entity>(entityClassOrName,indexSpecs):Promise<string[]>
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/MongoEntityManager.d.ts:138
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/.
Entity
EntityTarget<Entity>
Promise<string[]>
createCursor<
Entity,T>(entityClassOrName,query?):FindCursor<T>
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/MongoEntityManager.d.ts:98
Creates a cursor for a query that can be used to iterate over results from MongoDB.
Entity
T = any
EntityTarget<Entity>
FindCursor<T>
createEntityCursor<
Entity>(entityClassOrName,query?):FindCursor<Entity>
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/MongoEntityManager.d.ts:103
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.
Entity
EntityTarget<Entity>
FindCursor<Entity>
createQueryBuilder<
Entity>(entityClass,alias,queryRunner?):SelectQueryBuilder<Entity>
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/EntityManager.d.ts:82
Creates a new query builder that can be used to build a SQL query.
Entity extends ObjectLiteral
EntityTarget<Entity>
string
SelectQueryBuilder<Entity>
EntityManager.createQueryBuilder
createQueryBuilder(
queryRunner?):SelectQueryBuilder<any>
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/EntityManager.d.ts:86
Creates a new query builder that can be used to build a SQL query.
SelectQueryBuilder<any>
EntityManager.createQueryBuilder
decrement<
Entity>(entityClass,conditions,propertyPath,value):Promise<UpdateResult>
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/EntityManager.d.ts:374
Decrements some column by provided value of the entities matched given conditions.
Entity extends ObjectLiteral
EntityTarget<Entity>
any
string
string | number
Promise<UpdateResult>
delete<
Entity>(target,criteria):Promise<DeleteResult>
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/MongoEntityManager.d.ts:94
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.
Entity
EntityTarget<Entity>
string | number | string[] | Date | ObjectId | ObjectLiteral[] | number[] | Date[] | ObjectId[]
Promise<DeleteResult>
deleteAll<
Entity>(targetOrEntity):Promise<DeleteResult>
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/EntityManager.d.ts:246
Deletes all entities of target type. This is a primitive operation without cascades, relations or other operations included. Executes fast and efficient DELETE query without WHERE clause.
WARNING! This method deletes ALL rows in the target table.
Entity extends ObjectLiteral
EntityTarget<Entity>
Promise<DeleteResult>
deleteMany<
Entity>(entityClassOrName,query,options?):Promise<DeleteResult>
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/MongoEntityManager.d.ts:142
Delete multiple documents on MongoDB.
Entity
EntityTarget<Entity>
Promise<DeleteResult>
deleteOne<
Entity>(entityClassOrName,query,options?):Promise<DeleteResult>
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/MongoEntityManager.d.ts:146
Delete a document on MongoDB.
Entity
EntityTarget<Entity>
Promise<DeleteResult>
distinct<
Entity>(entityClassOrName,key,query,options?):Promise<any>
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/MongoEntityManager.d.ts:150
The distinct command returns returns a list of distinct values for the given key across a collection.
Entity
EntityTarget<Entity>
string
Promise<any>
dropCollectionIndex<
Entity>(entityClassOrName,indexName,options?):Promise<any>
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/MongoEntityManager.d.ts:154
Drops an index from this collection.
Entity
EntityTarget<Entity>
string
Promise<any>
dropCollectionIndexes<
Entity>(entityClassOrName):Promise<any>
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/MongoEntityManager.d.ts:158
Drops all indexes from the collection.
Entity
EntityTarget<Entity>
Promise<any>
protectedexecuteFind<Entity>(entityClassOrName,optionsOrConditions?):Promise<Entity[]>
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/MongoEntityManager.d.ts:257
Entity
EntityTarget<Entity>
any[] | MongoFindManyOptions<Entity> | Partial<Entity>
Promise<Entity[]>
executeFindAndCount<
Entity>(entityClassOrName,optionsOrConditions?):Promise<[Entity[],number]>
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/MongoEntityManager.d.ts:261
Finds entities that match given find options or conditions.
Entity
EntityTarget<Entity>
MongoFindManyOptions<Entity> | Partial<Entity>
Promise<[Entity[], number]>
protectedexecuteFindOne<Entity>(entityClassOrName,optionsOrConditions?,maybeOptions?):Promise<Entity|null>
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/MongoEntityManager.d.ts:256
Finds first entity that matches given conditions and/or find options.
Entity
EntityTarget<Entity>
any
MongoFindOneOptions<Entity>
Promise<Entity | null>
exists<
Entity>(entityClass,options?):Promise<boolean>
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/EntityManager.d.ts:266
Checks whether any entity exists with the given options.
Entity extends ObjectLiteral
EntityTarget<Entity>
FindManyOptions<Entity>
Promise<boolean>
existsBy<
Entity>(entityClass,where):Promise<boolean>
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/EntityManager.d.ts:270
Checks whether any entity exists with the given conditions.
Entity extends ObjectLiteral
EntityTarget<Entity>
FindOptionsWhere<Entity> | FindOptionsWhere<Entity>[]
Promise<boolean>
protectedfilterSoftDeleted<Entity>(cursor,deleteDateColumn,query?):void
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/MongoEntityManager.d.ts:252
Entity
FindCursor<Entity>
ColumnMetadata
void
find<
Entity>(entityClassOrName,optionsOrConditions?):Promise<Entity[]>
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/MongoEntityManager.d.ts:33
Finds entities that match given find options or conditions.
Entity
EntityTarget<Entity>
FindManyOptions<Entity> | Partial<Entity> | FilterOperators<Entity>
Promise<Entity[]>
findAndCount<
Entity>(entityClassOrName,options?):Promise<[Entity[],number]>
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/MongoEntityManager.d.ts:39
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).
Entity
EntityTarget<Entity>
MongoFindManyOptions<Entity>
Promise<[Entity[], number]>
findAndCountBy<
Entity>(entityClassOrName,where):Promise<[Entity[],number]>
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/MongoEntityManager.d.ts:43
Finds entities that match given where conditions.
Entity
EntityTarget<Entity>
any
Promise<[Entity[], number]>
findBy<
Entity>(entityClassOrName,where):Promise<Entity[]>
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/MongoEntityManager.d.ts:47
Finds entities that match given WHERE conditions.
Entity
EntityTarget<Entity>
any
Promise<Entity[]>
findByIds<
Entity>(entityClassOrName,ids,optionsOrConditions?):Promise<Entity[]>
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/MongoEntityManager.d.ts:54
Finds entities by ids. Optionally find options can be applied.
Entity
EntityTarget<Entity>
any[]
FindManyOptions<Entity> | Partial<Entity>
Promise<Entity[]>
use findBy method instead.
findOne<
Entity>(entityClassOrName,options):Promise<Entity|null>
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/MongoEntityManager.d.ts:58
Finds first entity that matches given conditions and/or find options.
Entity
EntityTarget<Entity>
MongoFindOneOptions<Entity>
Promise<Entity | null>
findOneAndDelete<
Entity>(entityClassOrName,query,options?):Promise<Document|null>
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/MongoEntityManager.d.ts:162
Find a document and delete it in one atomic operation, requires a write lock for the duration of the operation.
Entity
EntityTarget<Entity>
Promise<Document | null>
findOneAndReplace<
Entity>(entityClassOrName,query,replacement,options?):Promise<Document|null>
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/MongoEntityManager.d.ts:166
Find a document and replace it in one atomic operation, requires a write lock for the duration of the operation.
Entity
EntityTarget<Entity>
Promise<Document | null>
findOneAndUpdate<
Entity>(entityClassOrName,query,update,options?):Promise<Document|null>
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/MongoEntityManager.d.ts:170
Find a document and update it in one atomic operation, requires a write lock for the duration of the operation.
Entity
EntityTarget<Entity>
Promise<Document | null>
findOneBy<
Entity>(entityClassOrName,where):Promise<Entity|null>
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/MongoEntityManager.d.ts:62
Finds first entity that matches given WHERE conditions.
Entity
EntityTarget<Entity>
any
Promise<Entity | null>
findOneById<
Entity>(entityClassOrName,id):Promise<Entity|null>
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/MongoEntityManager.d.ts:72
Finds entity that matches given id.
Entity
EntityTarget<Entity>
string | number | Date | ObjectId
Promise<Entity | null>
use findOneBy method instead in conjunction with In operator, for example:
.findOneBy({ id: 1 // where "id" is your primary column name })
findOneByOrFail<
Entity>(entityClass,where):Promise<Entity>
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/EntityManager.d.ts:359
Finds first entity that matches given where condition. If entity was not found in the database - rejects with error.
Entity extends ObjectLiteral
EntityTarget<Entity>
FindOptionsWhere<Entity> | FindOptionsWhere<Entity>[]
Promise<Entity>
findOneOrFail<
Entity>(entityClass,options):Promise<Entity>
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/EntityManager.d.ts:354
Finds first entity by a given find options. If entity was not found in the database - rejects with error.
Entity extends ObjectLiteral
EntityTarget<Entity>
FindOneOptions<Entity>
Promise<Entity>
getCustomRepository<
T>(customRepository):T
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/EntityManager.d.ts:404
Gets custom entity repository marked with
T
ObjectType<T>
T
decorator.
use Repository.extend to create custom repositories
EntityManager.getCustomRepository
getId(
entity):any
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/EntityManager.d.ts:98
Gets entity mixed id.
any
any
getId(
target,entity):any
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/EntityManager.d.ts:102
Gets entity mixed id.
EntityTarget<any>
any
any
getMongoRepository<
Entity>(target):MongoRepository<Entity>
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/EntityManager.d.ts:392
Gets mongodb repository for the given entity class.
Entity extends ObjectLiteral
EntityTarget<Entity>
MongoRepository<Entity>
EntityManager.getMongoRepository
getRepository<
Entity>(target):Repository<Entity>
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/EntityManager.d.ts:381
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.
Entity extends ObjectLiteral
EntityTarget<Entity>
Repository<Entity>
getTreeRepository<
Entity>(target):TreeRepository<Entity>
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/EntityManager.d.ts:388
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.
Entity extends ObjectLiteral
EntityTarget<Entity>
TreeRepository<Entity>
EntityManager.getTreeRepository
hasId(
entity):boolean
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/EntityManager.d.ts:90
Checks if entity has an id.
any
boolean
hasId(
target,entity):boolean
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/EntityManager.d.ts:94
Checks if entity of given schema name has an id.
string | Function
any
boolean
increment<
Entity>(entityClass,conditions,propertyPath,value):Promise<UpdateResult>
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/EntityManager.d.ts:370
Increments some column by provided value of the entities matched given conditions.
Entity extends ObjectLiteral
EntityTarget<Entity>
any
string
string | number
Promise<UpdateResult>
initializeOrderedBulkOp<
Entity>(entityClassOrName,options?):OrderedBulkOperation
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/MongoEntityManager.d.ts:186
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.
Entity
EntityTarget<Entity>
initializeUnorderedBulkOp<
Entity>(entityClassOrName,options?):UnorderedBulkOperation
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/MongoEntityManager.d.ts:190
Initiate a Out of order batch write operation. All operations will be buffered into insert/update/remove commands executed out of order.
Entity
EntityTarget<Entity>
insert<
Entity>(target,entity):Promise<InsertResult>
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/MongoEntityManager.d.ts:80
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.
Entity
EntityTarget<Entity>
_QueryDeepPartialEntity<ObjectLiteral extends Entity ? unknown : Entity> | _QueryDeepPartialEntity<ObjectLiteral extends Entity ? unknown : Entity>[]
Promise<InsertResult>
insertMany<
Entity>(entityClassOrName,docs,options?):Promise<InsertManyResult<Document>>
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/MongoEntityManager.d.ts:194
Inserts an array of documents into MongoDB.
Entity
EntityTarget<Entity>
Promise<InsertManyResult<Document>>
insertOne<
Entity>(entityClassOrName,doc,options?):Promise<InsertOneResult<Document>>
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/MongoEntityManager.d.ts:198
Inserts a single document into MongoDB.
Entity
EntityTarget<Entity>
Promise<InsertOneResult<Document>>
isCapped<
Entity>(entityClassOrName):Promise<any>
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/MongoEntityManager.d.ts:202
Returns if the collection is a capped collection.
Entity
EntityTarget<Entity>
Promise<any>
listCollectionIndexes<
Entity>(entityClassOrName,options?):ListIndexesCursor
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/MongoEntityManager.d.ts:206
Get the list of all indexes information for the collection.
Entity
EntityTarget<Entity>
maximum<
Entity>(entityClass,columnName,where?):Promise<number|null>
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/EntityManager.d.ts:296
Return the MAX of a column
Entity extends ObjectLiteral
EntityTarget<Entity>
PickKeysByType<Entity, number>
FindOptionsWhere<Entity> | FindOptionsWhere<Entity>[]
Promise<number | null>
merge<
Entity>(entityClass,mergeIntoEntity, ...entityLikes):Entity
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/EntityManager.d.ts:116
Merges two entities into one new entity.
Entity extends ObjectLiteral
EntityTarget<Entity>
Entity
...DeepPartial<Entity>[]
Entity
minimum<
Entity>(entityClass,columnName,where?):Promise<number|null>
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/EntityManager.d.ts:292
Return the MIN of a column
Entity extends ObjectLiteral
EntityTarget<Entity>
PickKeysByType<Entity, number>
FindOptionsWhere<Entity> | FindOptionsWhere<Entity>[]
Promise<number | null>
preload<
Entity>(entityClass,entityLike):Promise<Entity|undefined>
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/EntityManager.d.ts:123
Creates a new entity from the given plain 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.
Entity extends ObjectLiteral
EntityTarget<Entity>
DeepPartial<Entity>
Promise<Entity | undefined>
query<
T>(query,parameters?):Promise<T>
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/EntityManager.d.ts:70
Executes raw SQL query and returns raw database results.
T = any
string
any[]
Promise<T>
Official docs for examples.
recover<
Entity>(entities,options?):Promise<Entity[]>
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/EntityManager.d.ts:193
Recovers all given entities.
Entity
Entity[]
Promise<Entity[]>
recover<
Entity>(entity,options?):Promise<Entity>
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/EntityManager.d.ts:197
Recovers a given entity.
Entity
Entity
Promise<Entity>
recover<
Entity,T>(targetOrEntity,entities,options?):Promise<T[]>
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/EntityManager.d.ts:201
Recovers all given entities.
Entity
T
EntityTarget<Entity>
T[]
Promise<T[]>
recover<
Entity,T>(targetOrEntity,entity,options?):Promise<T>
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/EntityManager.d.ts:205
Recovers a given entity.
Entity
T
EntityTarget<Entity>
T
Promise<T>
release():
Promise<void>
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/EntityManager.d.ts:410
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.
Promise<void>
remove<
Entity>(entity,options?):Promise<Entity>
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/EntityManager.d.ts:161
Removes a given entity from the database.
Entity
Entity
Promise<Entity>
remove<
Entity>(targetOrEntity,entity,options?):Promise<Entity>
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/EntityManager.d.ts:165
Removes a given entity from the database.
Entity
EntityTarget<Entity>
Entity
Promise<Entity>
remove<
Entity>(entity,options?):Promise<Entity>
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/EntityManager.d.ts:169
Removes a given entity from the database.
Entity
Entity[]
Promise<Entity>
remove<
Entity>(targetOrEntity,entity,options?):Promise<Entity[]>
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/EntityManager.d.ts:173
Removes a given entity from the database.
Entity
EntityTarget<Entity>
Entity[]
Promise<Entity[]>
rename<
Entity>(entityClassOrName,newName,options?):Promise<Collection<Document>>
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/MongoEntityManager.d.ts:210
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.
Entity
EntityTarget<Entity>
string
Promise<Collection<Document>>
replaceOne<
Entity>(entityClassOrName,query,doc,options?):Promise<Document|UpdateResult>
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/MongoEntityManager.d.ts:214
Replace a document on MongoDB.
Entity
EntityTarget<Entity>
Promise<Document | UpdateResult>
restore<
Entity>(targetOrEntity,criteria):Promise<UpdateResult>
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/EntityManager.d.ts:262
Restores entities 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.
Entity extends ObjectLiteral
EntityTarget<Entity>
any
Promise<UpdateResult>
save<
Entity>(entities,options?):Promise<Entity[]>
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/EntityManager.d.ts:128
Saves all given entities in the database. If entities do not exist in the database then inserts, otherwise updates.
Entity
Entity[]
Promise<Entity[]>
save<
Entity>(entity,options?):Promise<Entity>
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/EntityManager.d.ts:133
Saves all given entities in the database. If entities do not exist in the database then inserts, otherwise updates.
Entity
Entity
Promise<Entity>
save<
Entity,T>(targetOrEntity,entities,options):Promise<T[]>
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/EntityManager.d.ts:138
Saves all given entities in the database. If entities do not exist in the database then inserts, otherwise updates.
Entity
T
EntityTarget<Entity>
T[]
SaveOptions & object
Promise<T[]>
save<
Entity,T>(targetOrEntity,entities,options?):Promise<T&Entity[]>
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/EntityManager.d.ts:145
Saves all given entities in the database. If entities do not exist in the database then inserts, otherwise updates.
Entity
T
EntityTarget<Entity>
T[]
Promise<T & Entity[]>
save<
Entity,T>(targetOrEntity,entity,options):Promise<T>
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/EntityManager.d.ts:150
Saves a given entity in the database. If entity does not exist in the database then inserts, otherwise updates.
Entity
T
EntityTarget<Entity>
T
SaveOptions & object
Promise<T>
save<
Entity,T>(targetOrEntity,entity,options?):Promise<T&Entity>
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/EntityManager.d.ts:157
Saves a given entity in the database. If entity does not exist in the database then inserts, otherwise updates.
Entity
T
EntityTarget<Entity>
T
Promise<T & Entity>
softDelete<
Entity>(targetOrEntity,criteria):Promise<UpdateResult>
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/EntityManager.d.ts:254
Records the delete date of entities 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.
Entity extends ObjectLiteral
EntityTarget<Entity>
any
Promise<UpdateResult>
softRemove<
Entity>(entities,options?):Promise<Entity[]>
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/EntityManager.d.ts:177
Records the delete date of all given entities.
Entity
Entity[]
Promise<Entity[]>
softRemove<
Entity>(entity,options?):Promise<Entity>
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/EntityManager.d.ts:181
Records the delete date of a given entity.
Entity
Entity
Promise<Entity>
softRemove<
Entity,T>(targetOrEntity,entities,options?):Promise<T[]>
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/EntityManager.d.ts:185
Records the delete date of all given entities.
Entity
T
EntityTarget<Entity>
T[]
Promise<T[]>
softRemove<
Entity,T>(targetOrEntity,entity,options?):Promise<T>
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/EntityManager.d.ts:189
Records the delete date of a given entity.
Entity
T
EntityTarget<Entity>
T
Promise<T>
sql<
T>(strings, ...values):Promise<T>
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/EntityManager.d.ts:78
Tagged template function that executes raw SQL query and returns raw database results.
Template expressions are automatically transformed into database parameters.
Raw query execution is supported only by relational databases (MongoDB is not supported).
Note: Don't call this as a regular function, it is meant to be used with backticks to tag a template literal.
Example: entityManager.sqlSELECT * FROM table_name WHERE id = ${id}
T = any
TemplateStringsArray
...unknown[]
Promise<T>
stats<
Entity>(entityClassOrName,options?):Promise<CollStats>
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/MongoEntityManager.d.ts:218
Get all the collection statistics.
Entity
EntityTarget<Entity>
Promise<CollStats>
sum<
Entity>(entityClass,columnName,where?):Promise<number|null>
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/EntityManager.d.ts:284
Return the SUM of a column
Entity extends ObjectLiteral
EntityTarget<Entity>
PickKeysByType<Entity, number>
FindOptionsWhere<Entity> | FindOptionsWhere<Entity>[]
Promise<number | null>
transaction<
T>(runInTransaction):Promise<T>
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/EntityManager.d.ts:59
Wraps given function execution (and all operations made there) in a transaction. All database operations must be executed using provided entity manager.
T
(entityManager) => Promise<T>
Promise<T>
transaction<
T>(isolationLevel,runInTransaction):Promise<T>
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/EntityManager.d.ts:64
Wraps given function execution (and all operations made there) in a transaction. All database operations must be executed using provided entity manager.
T
IsolationLevel
(entityManager) => Promise<T>
Promise<T>
update<
Entity>(target,criteria,partialEntity):Promise<UpdateResult>
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/MongoEntityManager.d.ts:87
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.
Entity
EntityTarget<Entity>
string | number | string[] | ObjectLiteral | Date | ObjectId | number[] | Date[] | ObjectId[]
QueryDeepPartialEntity<Entity>
Promise<UpdateResult>
updateAll<
Entity>(target,partialEntity,options?):Promise<UpdateResult>
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/EntityManager.d.ts:230
Updates all entities of target type, setting fields from supplied partial entity. This is a primitive operation without cascades, relations or other operations included. Executes fast and efficient UPDATE query without WHERE clause.
WARNING! This method updates ALL rows in the target table.
Entity extends ObjectLiteral
EntityTarget<Entity>
QueryDeepPartialEntity<Entity>
Promise<UpdateResult>
updateMany<
Entity>(entityClassOrName,query,update,options?):Promise<Document|UpdateResult>
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/MongoEntityManager.d.ts:223
Update multiple documents on MongoDB.
Entity
EntityTarget<Entity>
Promise<Document | UpdateResult>
updateOne<
Entity>(entityClassOrName,query,update,options?):Promise<Document|UpdateResult>
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/MongoEntityManager.d.ts:227
Update a single document on MongoDB.
Entity
EntityTarget<Entity>
Promise<Document | UpdateResult>
upsert<
Entity>(target,entityOrEntities,conflictPathsOrOptions):Promise<InsertResult>
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/EntityManager.d.ts:214
Entity extends ObjectLiteral
EntityTarget<Entity>
_QueryDeepPartialEntity<ObjectLiteral extends Entity ? unknown : Entity> | _QueryDeepPartialEntity<ObjectLiteral extends Entity ? unknown : Entity>[]
string[] | UpsertOptions<Entity>
Promise<InsertResult>
watch<
Entity>(entityClassOrName,pipeline?,options?):ChangeStream
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/MongoEntityManager.d.ts:219
Entity
EntityTarget<Entity>
Document[]
withRepository<
Entity,R>(repository):R
定义于: node_modules/.pnpm/typeorm@0.3.30_ioredis@5.6.0_mongodb@6.19.0_mssql@11.0.1_mysql2@3.15.1_pg@8.11.3_ts-node@10.9_6zvdq3z7xgsf663jy3j6oymho4/node_modules/typeorm/entity-manager/EntityManager.d.ts:398
Creates a new repository instance out of a given Repository and sets current EntityManager instance to it. Used to work with custom repositories in transactions.
Entity extends ObjectLiteral
R extends Repository<any>
R & Repository<Entity>
R
- @142vip/axios
- @142vip/changelog
- @142vip/commit-linter
- @142vip/copyright
- @142vip/data-source
- @142vip/eslint-config
- @142vip/fairy-cli
- @142vip/grpc
- @142vip/nest
- @142vip/nest-redis
- @142vip/nest-typeorm
- @142vip/oauth2.0
- @142vip/open-source
- @142vip/redis
- @142vip/release-version
- @142vip/typeorm
- @142vip/utils