Details
-
Bug
-
Resolution: Done
-
Major - P3
-
None
-
windows 8
*Location*: http://docs.mongodb.org/manual/reference/operator/update/pull/#up._S_pull
*User-Agent*: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.85 Safari/537.36
*Referrer*: http://docs.mongodb.org/manual/reference/operator/update-array/
*Screen Resolution*: 1366 x 768
*repo*: docs
*source*: reference/operator/update/pull
windows 8 *Location*: http://docs.mongodb.org/manual/reference/operator/update/pull/#up._S_pull *User-Agent*: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.85 Safari/537.36 *Referrer*: http://docs.mongodb.org/manual/reference/operator/update-array/ *Screen Resolution*: 1366 x 768 *repo*: docs *source*: reference/operator/update/pull
-
0.25
Description
{
_id: 1,
results: [
,
{ item: "B", score: 8, comment: "Strongly agree" } ]
}
{
_id: 2,
results: [
,
{ item: "B", score: 4 } ]
}
The following operation will remove from the results array all elements that contain both a score field equal to 8 and an item field equal to "B":
db.survey.update(
{ },
{ $pull: { results:
} },
{ multi: true })
here the $pull operator does not remove result with
{score:8,item:"B"}as $pull for array of documents requires all fields to match.