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

find() on field names starting with '$' behaves differently 2.4 v 2.5

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • 2.4.9
    • 2.5.4
    • Querying
    • Minor Change
    • ALL
    • Hide

      2.4.9-pre-

      > db.c.insert({a:2});
      > db.c.find({"$c":{$ne:5}});
      { "_id" : ObjectId("528d4b02679ed5d9487c0bea"), "a" : 2 }

      2.5.5-pre-

      > db.c.insert({a:2});
      > db.c.find({"$c":{$ne:5}});
      error: {
      	"$err" : "bad query: BadValue unknown top level operator: $c",
      	"code" : 16810
      }

      Show
      2.4.9-pre- > db.c.insert({a:2}); > db.c.find({"$c":{$ne:5}}); { "_id" : ObjectId("528d4b02679ed5d9487c0bea"), "a" : 2 } 2.5.5-pre- > db.c.insert({a:2}); > db.c.find({"$c":{$ne:5}}); error: { "$err" : "bad query: BadValue unknown top level operator: $c", "code" : 16810 }

    Description

      It is possible to do a query on a field starting with '$' in mongodb 2.4.9-pre-. This is not possible in version 2.5.x. The purpose of this ticket is to determine if this change is intentional and if this "feature" should exist in 2.4.

      Attachments

        Activity

          People

            Unassigned Unassigned
            luke.lovett Luke Lovett
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: