$query unsupported operator

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Duplicate
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Querying
    • None
    • ALL
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      According to the latest docs the following should be supported:

      When I run the following query I get results:

      db.mycollection.find({"$query":{}, "$orderby":{"myfield":1});
      

      When I run the following explain:

      db.mycollection.find({"$query":{}, "$orderby":{"myfield":1}).explain();
      

      I get the following error:

      2014-05-29T15:29:46.939-0700 error: {
      	"$err" : "Can't canonicalize query: BadValue unknown top level operator: $query",
      	"code" : 17287
      } at src/mongo/shell/query.js:131
      

      Why can't I do an explain on a valid query?

            Assignee:
            Thomas Rueckstiess (Inactive)
            Reporter:
            Steve Owens
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: