array $pull operator

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Done
    • Priority: Major - P3
    • 0.9.7
    • Affects Version/s: None
    • Component/s: Usability
    • None
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      I believe adding a $pull modifier - the opposite of $push - would be a
      powerful addition to the MongoDB features.

      For example:

      db.group.insert({_id:1,text:'user group 1',users:[1,2,3]});

      // add another user - atomic
      db.blogs.update({_id:1},{ $push :

      { users : 4 }

      } );

      // remove a user - atomic
      db.blogs.update({_id:1},{ $pull :

      { users : 2 }

      });

              Assignee:
              Aaron Staple (Inactive)
              Reporter:
              Eliot Horowitz (Inactive)
              Votes:
              4 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: