[SERVER-3988] should regex matching work with $pull? it doesn't. Created: 30/Sep/11  Updated: 11/Jul/16  Resolved: 19/Sep/13

Status: Closed
Project: Core Server
Component/s: Write Ops
Affects Version/s: None
Fix Version/s: 2.5.3

Type: Bug Priority: Minor - P4
Reporter: Dwight Merriman Assignee: Andrew Morrow (Inactive)
Resolution: Done Votes: 1
Labels: $pull, regex
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-2016 $pull with $elemMatch and $in does no... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Participants:

 Description   

> t.find(

{x:1}

)

{ "_id" : ObjectId("4e8634b96c26412b2e1418b4"), "x" : 1, "y" : [ 2, 3, 4, "abc", "xyz" ] }

>
> t.update(

{x:1}

, {$pull:{y:3}})
> t.find(

{x:1}

)

{ "_id" : ObjectId("4e8634b96c26412b2e1418b4"), "x" : 1, "y" : [ 2, 4, "abc", "xyz" ] }

>
> t.update(

{x:1}

, {$pull:{y:{$lt:3}}})
> t.find(

{x:1}

)

{ "_id" : ObjectId("4e8634b96c26412b2e1418b4"), "x" : 1, "y" : [ 4, "abc", "xyz" ] }

> t.update(

{x:1}

, {$pull:{y:/yz/}})
> t.find(

{x:1}

)

{ "_id" : ObjectId("4e8634b96c26412b2e1418b4"), "x" : 1, "y" : [ 4, "abc", "xyz" ] }

 Comments   
Comment by auto [ 19/Sep/13 ]

Author:

{u'username': u'acmorrow', u'name': u'Andrew Morrow', u'email': u'acm@10gen.com'}

Message: SERVER-3988 Implement support for $pull with a regex
Branch: master
https://github.com/mongodb/mongo/commit/8798b7e6c1e4916de7ff110129e9116c3e482fc8

Generated at Thu Feb 08 03:04:37 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.