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

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.5.4
    • Affects Version/s: 2.4.9
    • Component/s: Querying
    • Labels:
    • Environment:
    • 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 }

      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.

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

              Created:
              Updated:
              Resolved: