I am attempting to remove a value from multiple arrays without having to issue multiple Mongo commands. I must have my syntax incorrect, any help would be appreciated.
When I try:
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),
"}"
);
It fails if I simplify it down to just the following it works:
update = BCON_NEW("$pull",
"{",
"files.$.like", BCON_UTF8 (account_id),
"}"
);