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

skip does not skip on a '2d' near search.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor - P4
    • Resolution: Duplicate
    • Affects Version/s: 2.0.6, 2.3.2
    • Fix Version/s: None
    • Component/s: Querying
    • Labels:
      None
    • Environment:
      Linux
    • Operating System:
      ALL

      Description

      Some code to reproduce bug:

      > db.geo.insert(

      {coords:[0,1], field: 1}

      )
      > db.geo.insert(

      {coords:[2.3,1.4], field: 2}

      )
      > db.geo.insert(

      {coords:[1,5], field: 0}

      )
      > db.geo.ensureIndex(

      {coords: "2d"}

      )

      Then:

      > db.geo.find({coords : {$near:[1,1]}})

      { "_id" : ObjectId("4fe1e02e033df621f3c59861"), "coords" : [ 0, 1 ], "field" : 1 } { "_id" : ObjectId("4fe1e037033df621f3c59862"), "coords" : [ 2.3, 1.4 ], "field" : 2 } { "_id" : ObjectId("4fe1e03f033df621f3c59863"), "coords" : [ 1, 5 ], "field" : 0 }

      Seems ok!

      > db.geo.find({coords : {$near:[1,1]}}).skip(1)

      Bug?

      > db.geo.find({coords : {$near:[1,1]}}).skip(1).limit(1)

      { "_id" : ObjectId("4fe1e037033df621f3c59862"), "coords" : [ 2.3, 1.4 ], "field" : 2 }

      ?!

      Btw my php code doesn't work with limit() setted.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: