doing a geo $near search with other fields in the query makes it so the results can't be sorted

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Cannot Reproduce
    • Priority: Major - P3
    • None
    • Affects Version/s: 1.4.4, 1.5.6
    • Component/s: Geo, Querying
    • None
    • Environment:
      os: Windows 7
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      creating an index like this:

      db.places.ensureIndex(

      { loc : "2d", foo: 1 }

      )

      then querying on the index like this fails return the expected result:

      db.places.find({loc: {$near: [37.775,-122.4183333]},foo: {$gte: 100}}).sort(

      {foo:1}

      );

      if you take out the second part of the query (the foo: {$gte: 100}) but leave in the sort then it returns the expected result.

            Assignee:
            Eliot Horowitz (Inactive)
            Reporter:
            Jay Marcyes
            Votes:
            3 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: