-
Type: Improvement
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: manual
-
Labels:
-
Environment:
*Location*: http://docs.mongodb.org/manual/reference/operator/update/pull/
*User-Agent*: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.153 Safari/537.36
*Referrer*: https://www.google.com/
*Screen Resolution*: 1920 x 1080
*repo*: docs
*source*: reference/operator/update/pull
*Location*: http://docs.mongodb.org/manual/reference/operator/update/pull/ *User-Agent*: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.153 Safari/537.36 *Referrer*: https://www.google.com/ *Screen Resolution*: 1920 x 1080 *repo*: docs *source*: reference/operator/update/pull
Please add a section describing how to $pull subdocuments from an array, since $elemMatch doesn't work and instead, we need to use (what I think is) a non-standard query operation.
For example, if you have this document:
{x: 0, y: [ {a:1} , {a:2} ]}
this works:
{$pull: {y: {a: 2}}}
but this does not:
{$pull: {y: {$elemMatch: {a: 2}}}}