Query near vs. within

前端 未结 1 1149
难免孤独
难免孤独 2021-01-13 10:11

Using MongoDB I\'m querying homes that are within 25 miles of a lat/long.

My first attempt to do this used the near command, like so:

var near = Quer         


        
相关标签:
1条回答
  • 2021-01-13 10:43

    Geospatial $near queries set a default limit() of 100 results. You should be able to get more results by setting a new limit().

    While "near" queries are sorted by distance, "within" is not (although "within" doesn't have a default limit).

    0 讨论(0)
提交回复
热议问题