0
我試圖從多個數組中刪除一個值,而不必發出多個Mongo命令。我必須有我的語法不正確,任何幫助將不勝感激。
當我嘗試:
update = BCON_NEW("$pull",
"{",
"files.$.like", BCON_UTF8 (account_id),
"}",
"{",
"files.$.hate", BCON_UTF8 (account_id),
"}",
"{",
"files.$.love", BCON_UTF8 (account_id),
"}",
"{",
"files.$.funny", BCON_UTF8 (account_id),
"}",
"{",
"files.$.sad", BCON_UTF8 (account_id),
"}",
"{",
"files.$.anger", BCON_UTF8 (account_id),
"}",
"{",
"files.$.kiss", BCON_UTF8 (account_id),
"}"
);
,如果我把它簡化到只有它的工作原理如下失敗:
update = BCON_NEW("$pull",
"{",
"files.$.like", BCON_UTF8 (account_id),
"}"
);