[DOCS-6460] Comment on: "manual/reference/operator/update/pull.txt" Created: 27/Oct/15  Updated: 12/Dec/16  Resolved: 31/Mar/16

Status: Closed
Project: Documentation
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Docs Collector User (Inactive) Assignee: Steve Renaker (Inactive)
Resolution: Done Votes: 0
Labels: collector-298ba4e7
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Location: https://docs.mongodb.org/manual/reference/operator/update/pull/
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36
Referrer: https://www.google.ca/
Screen Resolution: 1440 x 900
repo: docs
source: reference/operator/update/pull


Participants:
Days since reply: 7 years, 9 weeks, 6 days ago

 Description   

$gte should be $lte or the example should be updated

--------
The following operation will remove all items from the votes array that are greater than or equal to ($gte) 6:

db.profiles.update(

{ _id: 1 }

, { $pull: { votes:

{ $gte: 6 }

} } )

After the update operation, the document only has values less than 6:



 Comments   
Comment by Steve Renaker (Inactive) [ 08/Dec/16 ]

Hi Emily – I'm not sure what's going on with this ticket. Did you want to
re-open it?

Comment by Steve Renaker (Inactive) [ 31/Mar/16 ]

I believe this example is behaving as expected. The operation isn't expected to return the values greater than or equal to 6; it removes them from the array. The document at the end of the example:

 
   { _id: 1, votes: [  3,  5 ] }

shows the document's contents after the $pull operation.

Thanks for getting involved, and let me know if anything still doesn't seem right.

Generated at Thu Feb 08 07:52:20 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.