Class WriteConcern

A MongoDB WriteConcern, which describes the level of acknowledgement requested from MongoDB for write operations.一个MongoDB WriteConcern,它描述了MongoDB为写操作请求的确认级别。

Hierarchy

  • WriteConcern

Constructors

  • Constructs a WriteConcern from the write concern properties.从写关注属性构造一个WriteConcern。

    Parameters

    • Optional w: W

      request acknowledgment that the write operation has propagated to a specified number of mongod instances or to mongod instances with specified tags.请求确认写入操作已传播到指定数量的mongod实例或具有指定标记的mongod实例。

    • Optional wtimeoutMS: number

      specify a time limit to prevent write operations from blocking indefinitely指定时间限制以防止写入操作无限期地阻止

    • Optional journal: boolean

      request acknowledgment that the write operation has been written to the on-disk journal请求确认写入操作已写入磁盘上的日志

    • Optional fsync: boolean | 1

      equivalent to the j option. Is deprecated and will be removed in the next major version.相当于j选项。已弃用,并将在下一个主要版本中删除。

    Returns WriteConcern

Properties

fsync?: boolean | 1

Equivalent to the j option.相当于j选项。

Deprecated

Will be removed in the next major version. Please use journal.将在下一个主要版本中删除。请使用日记账。

j?: boolean

Request acknowledgment that the write operation has been written to the on-disk journal.请求确认写入操作已写入磁盘上的日志。

Deprecated

Will be removed in the next major version. Please use journal.将在下一个主要版本中删除。请使用日记账。

journal?: boolean

Request acknowledgment that the write operation has been written to the on-disk journal请求确认写入操作已写入磁盘上的日志

w?: W

Request acknowledgment that the write operation has propagated to a specified number of mongod instances or to mongod instances with specified tags.请求确认写入操作已传播到指定数量的mongod实例或具有指定标记的mongod实例。

wtimeout?: number

Specify a time limit to prevent write operations from blocking indefinitely.指定一个时间限制,以防止写入操作无限期地被阻止。

Deprecated

Will be removed in the next major version. Please use wtimeoutMS.将在下一个主要版本中删除。请使用wtimeoutMS。

wtimeoutMS?: number

Specify a time limit to prevent write operations from blocking indefinitely指定时间限制以防止写操作无限期地阻止

Methods

Generated using TypeDoc