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

$pull using DBRef $id and $in operator

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.6.5
    • Component/s: Querying
    • None
    • ALL
    • Hide

      I have this two documents:

      {
      foo : "test2",
      rel : [

      { $ref : "bar", $id : ObjectId("54773af88328753e92484be8") }

      ,

      { $ref : "bar", $id : ObjectId("54480b5f18c7885d7651a140") }

      ]
      }

      {
      foo : "test2",
      rel : [

      { $ref : "bar", $id : ObjectId("54480b5f18c7885d7651a140") }

      ,

      { $ref : "bar", $id : ObjectId("54773af88328753e92484be8") }

      ]
      }

      When I use $pull to remove some of DBRef entries and using $in too, none of them are removed.

      This is the query:

      db.test.update({}, {$pull:
      { rel:
      { "$id":

      { $in: [ ObjectId("54773af88328753e92484be8"), ObjectId("5477954518c7885d7651a15a") ] }

      }
      }
      })

      Show
      I have this two documents: { foo : "test2", rel : [ { $ref : "bar", $id : ObjectId("54773af88328753e92484be8") } , { $ref : "bar", $id : ObjectId("54480b5f18c7885d7651a140") } ] } { foo : "test2", rel : [ { $ref : "bar", $id : ObjectId("54480b5f18c7885d7651a140") } , { $ref : "bar", $id : ObjectId("54773af88328753e92484be8") } ] } When I use $pull to remove some of DBRef entries and using $in too, none of them are removed. This is the query: db.test.update({}, {$pull: { rel: { "$id": { $in: [ ObjectId("54773af88328753e92484be8"), ObjectId("5477954518c7885d7651a15a") ] } } } })
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      When I use $pull to remove some DBRef using $id and $in operator, none of them are remove.

      If the $id field have another name works.

            Assignee:
            Unassigned Unassigned
            Reporter:
            gabrielbrieva Gabriel Brieva
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: