Learn R Programming

RMongo (version 0.0.25)

dbSetWriteConcern-methods: Set write concern.

Description

This is an optional method to set the write concern for a given Mongo DB connection. By default the Mongo DB library does not check if a write (insert, update, remove) actually succeed.

Usage

dbSetWriteConcern(rmongo.object, w, wtimeout, fsync, j)

Arguments

rmongo.object
RMongo object containing the database connection information.
w
Number of write to aknowledge. -1 Don't even report network errors. 0 Don't wait for acknowledgement from the server. 1 Wait for acknowledgement but don't wait for secondaries to replicate. 2+ Wait for one or more secondaries to also acknowledge.
wtimeout
How long to wait for slaves before failing. 0 indefinite. Greater than 0 milliseconds to wait.
j
Wait for group commit to journal.
fsync
Force fsync to disk.

Examples

Run this code
  mongo <- mongoDbConnect("test")
  dbSetWriteConcern(mongo, 1, 0, FALSE, FALSE)
  dbDisconnect(mongo)

Run the code above in your browser using DataLab