Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-19303

$pull is pulling only in last occurence of query,db.getCollection('sid').update({_id:1},{$pull:{array1:"sid"},$pull:{array2:"kp"}})

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • None
    • None
    • Write Ops
    • None
    • ALL

    Description

      Pull operation works only on one array even called twice over a document

      Over this document

      { "_id" : 1, "array1" : [ "sid", "yd" ], "array2" : [ "ram", "kp" ] }

      I have run following query

      db.getCollection('sid').update({_id:1},{$pull:

      {array1:"sid"}

      ,$pull:{array2:"kp"}})

      result:

      { "_id" : 1, "array1" : [ "sid", "yd" ], "array2" : [ "ram" ] }

      Attachments

        Activity

          People

            sam.kleinman Sam Kleinman (Inactive)
            sid@testbook.com siddharth jain
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: