How can I make PHP inserts/update safe by default?

48 views
Skip to first unread message

Arkadiy

unread,
Sep 6, 2012, 1:31:14 PM9/6/12
to mongod...@googlegroups.com
We've recently suffered from some missing data due to (I suspect) master switchover during inserts. How can I avoid this without writing array(safe=> true) in every single insert/update?

Basically I want connection-level safe => true default that I can occasionally override with safe => false for throughput-oriented data.

Unfortunately, it looks like the php drives doesn't support the ?safe=1 syntax ("argument 27017?safe=1 isn't numeric") and setting w=1 at connection level still appears to require specifying safe => true per query.

Hannes Magnusson

unread,
Sep 10, 2012, 7:24:48 AM9/10/12
to mongod...@googlegroups.com
That is an excellent point - we don't actually support safe writes on
the connection level..

We are in the process of rolling out 1.3.0.. could you file a jira
ticket about this issue?
This is definitely something we should look at :)

-Hannes

Arkadiy

unread,
Sep 13, 2012, 3:03:44 PM9/13/12
to mongod...@googlegroups.com
Looks like there is already one here:


added my thoughts
Reply all
Reply to author
Forward
0 new messages