3
據我可以判斷,當我設置寫「安全」=真,它設置選項w = 1,j = 0,它確認獲得寫操作,但不確認寫入磁盤耐久性)。事情是這樣的:mongodb寫關注
$collection->remove(array('_id' => array('$in' => $idsToDelete)), array('safe' => true));
我可以設置W = 1,j = 1到保證耐用性(而不是在最新的驅動程序)?
據我可以判斷,當我設置寫「安全」=真,它設置選項w = 1,j = 0,它確認獲得寫操作,但不確認寫入磁盤耐久性)。事情是這樣的:mongodb寫關注
$collection->remove(array('_id' => array('$in' => $idsToDelete)), array('safe' => true));
我可以設置W = 1,j = 1到保證耐用性(而不是在最新的驅動程序)?
通過PHP驅動程序,您可以訪問個人write concern選項。
對於你的情況將是:
$collection->remove(
array('_id' => array('$in' => $idsToDelete)),
array("w" => 1, "j" => true));