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

$pull using DBRef $id and $in operator

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • None
    • 2.6.5
    • 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") ] } } } })

    Description

      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.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: