Safe/Unsafe Inserts using C++ Driver

449 views
Skip to first unread message

Ajoy Bose

unread,
May 8, 2012, 9:55:49 PM5/8/12
to mongod...@googlegroups.com
How do I set Safe/Unsafe for Inserts using the C++ driver?
Probably related,
mongo::DBClientBase::insert(..) has the int flags=0 argument, but I can't find where the flags options are specified, can someone please let me know where I can find that?

Thanks

Kyle Banker

unread,
May 9, 2012, 11:57:16 AM5/9/12
to mongod...@googlegroups.com
Before calling insert, you should set the write concern:

See setWriteConcern( WriteConcern w )

The value of WriteConcern should be W_NORMAL, which is equivalent to safe mode.

Ajoy Bose

unread,
May 10, 2012, 10:28:06 AM5/10/12
to mongod...@googlegroups.com
Thanks.
Reply all
Reply to author
Forward
0 new messages