MongoLink`
MongoLink`

MongoWriteConcernCreate

MongoWriteConcernCreate[]

creates an immutable MongoWriteConcern object.

MongoWriteConcernCreate[w]

creates a MongoWriteConcern object with acknowledgement level w.

Details

  • To use MongoWriteConcernCreate, you first need to load MongoLink using Needs["MongoLink`"].
  • w is an integer greater than or equal to 0. Used with replication, write operations will block until they have been replicated to the specified number or tagged set of servers. w always includes the replica set primary (e.g. w=3 means write to the primary and wait until replicated to two secondaries).
  • w with a value of 0 disables acknowledgement of write operations and can not be used with other write concern options.
  • w=0 disables acknowledgement of write operations and can not be used with other write concern options.
  • The following options are supported:
  • "Journal"TrueBlock until write operations have been committed to the journal.
    "Timeout"NoneA value in milliseconds to control how long to wait for write propagation to complete.
  • Prior to MongoDB 2.6, the option "Journal" was ignored if the server was running without journaling. Starting with MongoDB 2.6 write operations will fail with an exception if this option is used when the server is running without journaling.
  • The option "Timeout" is used in conjunction with w. Specify a value in milliseconds to control how long to wait for write propagation to complete. If replication does not complete in the given timeframe, a timeout exception is raised.
  • See the MongoDB write concern documentation for more information.

Examples

Basic Examples  (2)

In[1]:=
Click for copyable input

Create a MongoWriteConcern object:

In[1]:=
Click for copyable input
Out[1]=
In[1]:=
Click for copyable input

Create a MongoWriteConcern object with acknowledgement of write operations disabled:

In[2]:=
Click for copyable input
Out[2]=