As far as I can judge when I set for write "safe" = true, it sets options w = 1, j = 0, it confirms getting of write operation, but doesn't confirm writing to disk (durability). Something like this:
$collection->remove(array('_id' => array('$in' => $idsToDelete)), array('safe' => true));
Can I set w = 1, j = 1 to guarantee durability (not in the newest driver)?
The PHP driver gives you access to the individual write concern options.
For your case it would be:
$collection->remove(
array('_id' => array('$in' => $idsToDelete)),
array("w" => 1, "j" => true));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With