|
There is a default limit of 100 results for a geo query. But when a skip or limit is supplied skip + limit results are returned. When skip is supplied but limit is not supplied, a limit of 0 is used and no results are returned.
> c.ensureIndex( { a:'2d' } )
|
> c.save( { a:[ 0, 0 ] } )
|
> c.save( { a:[ 0, 0 ] } )
|
> c.find( { a:{ $near:[ 0, 0 ] } } )
|
{ "_id" : ObjectId("4f6d0ac3da35890a46b4b213"), "a" : [ 0, 0 ] }
|
{ "_id" : ObjectId("4f6d0ac4da35890a46b4b214"), "a" : [ 0, 0 ] }
|
> c.find( { a:{ $near:[ 0, 0 ] } } ).skip( 1 ).limit( 1 )
|
{ "_id" : ObjectId("4f6d0ac4da35890a46b4b214"), "a" : [ 0, 0 ] }
|
> c.find( { a:{ $near:[ 0, 0 ] } } ).skip( 1 )
|
>
|
|