Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 17th, 2012  |  syntax: None  |  size: 0.59 KB  |  hits: 18  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Is there any way to skip some documents in GeoNear() MongoDB method?
  2. type is specified:
  3.  
  4. {
  5.     id: ObjectId,
  6.     location : {double, double}, /*array, that contains
  7.                                    just longitude and latitude*/
  8.     someUsefulData : string
  9. }
  10.        
  11. // set GetNear() options
  12. var options = new GeoNearOptionsBuilder()
  13.     .SetMaxDistance(50) // meens 50 miles
  14.     .SetSpherical(true);
  15.  
  16. // create conditions query
  17. var conditions = Query.NE("someUsefulData ", $ne : {null});
  18.  
  19. // execute GetNear()
  20. var geoNearResult = collection
  21.     .GeoNear(conditions, longitude, latitude, limit, options);