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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 2.4.9
    • Fix Version/s: 2.5.4
    • Component/s: Querying
    • Labels:
    • Environment:
    • Backwards Compatibility:
      Minor Change
    • Operating System:
      ALL
    • Steps To Reproduce:
      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

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

              Dates

              • Created:
                Updated:
                Resolved: