• Public
  • Public/Protected
  • All

Interface RemoveOptions


  • RemoveOptions




Optional j

j: undefined | true | false

Whether to wait for the write to be commited to the server's journal (flushed to disk) or not. By specifying 1 here, you imply w:1 - howver this can be combined with w:"majority" to give excellent write reliability within a cluster, even across failures.

Optional single

single: undefined | true | false

Whether to only remove the first document in the collection or not, by default this is false and any document matching the conditions will be removed.

Optional w

w: string | number

The write concern, can either be a number from 0 to the number of nodes within the cluster, or "majority" if you would like to wait for the majority of nodes within the cluster to confirm the write before returning.

It is recommended that you set this to "majority", however in all situations where you mind if data is lost, you should set it to at least 1.

Optional wtimeout

wtimeout: undefined | number

The timeout in milliseconds before the write will be aborted by the MongoDB server and an error response (if the write concern is non-zero) is returned to the client.

Generated using TypeDoc