Skip to content

@142vip.nest typeorm.类.WriteConcern

mmdapl edited this page Oct 8, 2026 · 1 revision

API 参考 / @142vip/nest-typeorm / WriteConcern

类: WriteConcern

定义于: 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/driver/mongodb/typings.d.ts:5423

A MongoDB WriteConcern, which describes the level of acknowledgement requested from MongoDB for write operations.

参阅

https://www.mongodb.com/docs/manual/reference/write-concern/

构造函数

构造函数

new WriteConcern(w?, wtimeout?, j?, fsync?): WriteConcern

定义于: 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/driver/mongodb/typings.d.ts:5439

Constructs a WriteConcern from the write concern properties.

参数

w?

W

request acknowledgment that the write operation has propagated to a specified number of mongod instances or to mongod instances with specified tags.

wtimeout?

number

specify a time limit to prevent write operations from blocking indefinitely

j?

boolean

request acknowledgment that the write operation has been written to the on-disk journal

fsync?

boolean | 1

equivalent to the j option

返回

WriteConcern

属性

fsync?

optional fsync?: boolean | 1

定义于: 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/driver/mongodb/typings.d.ts:5431

equivalent to the j option


j?

optional j?: 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/driver/mongodb/typings.d.ts:5429

request acknowledgment that the write operation has been written to the on-disk journal


w?

optional w?: W

定义于: 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/driver/mongodb/typings.d.ts:5425

request acknowledgment that the write operation has propagated to a specified number of mongod instances or to mongod instances with specified tags.


wtimeout?

optional wtimeout?: 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/driver/mongodb/typings.d.ts:5427

specify a time limit to prevent write operations from blocking indefinitely

方法

fromOptions()

static fromOptions(options?, inherit?): WriteConcern | 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/driver/mongodb/typings.d.ts:5441

Construct a WriteConcern given an options object.

参数

options?

WriteConcernOptions | WriteConcern | W

inherit?

WriteConcernOptions | WriteConcern

返回

WriteConcern | undefined

Clone this wiki locally