Repository navigation
@142vip.nest typeorm.类.EntityManager
API 参考 / @142vip/nest-typeorm / EntityManager
定义于: 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:30
Entity manager supposed to work with any entity, automatically find its repository and call its methods, whatever entity type are you passing.
new EntityManager(
connection,queryRunner?):EntityManager
定义于: 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:54
EntityManager
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/EntityManager.d.ts:31
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.
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.
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>
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
count<
Entity>(entityClass,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/EntityManager.d.ts:275
Counts entities that match given options. Useful for pagination.
Entity extends ObjectLiteral
EntityTarget<Entity>
FindManyOptions<Entity>
Promise<number>
countBy<
Entity>(entityClass,where):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/EntityManager.d.ts:280
Counts entities that match given conditions. Useful for pagination.
Entity extends ObjectLiteral
EntityTarget<Entity>
FindOptionsWhere<Entity> | FindOptionsWhere<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[]
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>
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>
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>(targetOrEntity,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/EntityManager.d.ts:238
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.
Entity extends ObjectLiteral
EntityTarget<Entity>
any
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>
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>
find<
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:301
Finds entities that match given find options.
Entity extends ObjectLiteral
EntityTarget<Entity>
FindManyOptions<Entity>
Promise<Entity[]>
findAndCount<
Entity>(entityClass,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/EntityManager.d.ts:311
Finds entities that match given find options. Also counts all entities that match given conditions, but ignores pagination settings (from and take options).
Entity extends ObjectLiteral
EntityTarget<Entity>
FindManyOptions<Entity>
Promise<[Entity[], number]>
findAndCountBy<
Entity>(entityClass,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/EntityManager.d.ts:317
Finds entities that match given WHERE conditions. Also counts all entities that match given conditions, but ignores pagination settings (from and take options).
Entity extends ObjectLiteral
EntityTarget<Entity>
FindOptionsWhere<Entity> | FindOptionsWhere<Entity>[]
Promise<[Entity[], number]>
findBy<
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:305
Finds entities that match given find options.
Entity extends ObjectLiteral
EntityTarget<Entity>
FindOptionsWhere<Entity> | FindOptionsWhere<Entity>[]
Promise<Entity[]>
findByIds<
Entity>(entityClass,ids):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:328
Finds entities with ids. Optionally find options or conditions can be applied.
Entity extends ObjectLiteral
EntityTarget<Entity>
any[]
Promise<Entity[]>
use findBy method instead in conjunction with In operator, for example:
.findBy({ id: In([1, 2, 3]) })
findOne<
Entity>(entityClass,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/EntityManager.d.ts:333
Finds first entity by a given find options. If entity was not found in the database - returns null.
Entity extends ObjectLiteral
EntityTarget<Entity>
FindOneOptions<Entity>
Promise<Entity | null>
findOneBy<
Entity>(entityClass,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/EntityManager.d.ts:338
Finds first entity that matches given where condition. If entity was not found in the database - returns null.
Entity extends ObjectLiteral
EntityTarget<Entity>
FindOptionsWhere<Entity> | FindOptionsWhere<Entity>[]
Promise<Entity | null>
findOneById<
Entity>(entityClass,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/EntityManager.d.ts:349
Finds first entity that matches given id. If entity was not found in the database - returns null.
Entity extends ObjectLiteral
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
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>
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>
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>
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/EntityManager.d.ts:213
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 extends ObjectLiteral
EntityTarget<Entity>
_QueryDeepPartialEntity<ObjectLiteral extends Entity ? unknown : Entity> | _QueryDeepPartialEntity<ObjectLiteral extends Entity ? unknown : Entity>[]
Promise<InsertResult>
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[]>
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>
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,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:222
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.
Entity extends ObjectLiteral
EntityTarget<Entity>
any
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>
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>
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