次の形式のドキュメントがあります。
[uuid] => d030b8d1
[commentstrings] => Array (
[0] => 1366220389#mac@test.org#test 1
[1] => 1366220422#mac@test.org#test 2
[2] => 1366220458#mac@test.org#test 3
)
コメント文字列の 1 つの完全な文字列があり、その値を削除したいと考えています。
CLIでこれを試してみると、うまくいきます:
db.messages.update(
{'uuid':'d030b8d1'},
{ $pull : {
'commentstrings': '1366220422#mac@test.org#test 2'
}}
)
しかし、PHP で同じことを試しても何も起こりません。
$response = $stdb->messages->update(
array('uuid'=>'d030b8d1'),
array('$pull' => array('commentstrings' => '1366220422#mac@test.org#test 2'))
);
ここで私が間違っていることは何ですか?