Example #1
0
 public GeoNearResult GeoNearAs(Type documentType, IMongoQuery query, double x, double y, int limit, IMongoGeoNearOptions options)
 {
     return(_collection.GeoNearAs(documentType, query, x, y, limit, options));
 }
Example #2
0
        public static Task <GeoNearResult <T> > GeoNearAsAsync <T>(this MongoCollection collection, IMongoQuery query, Double x, Double y, Int32 limit, IMongoGeoNearOptions options)
        {
            var tcs = new TaskCompletionSource <GeoNearResult <T> >();

            ThreadPool.QueueUserWorkItem(_ =>
            {
                try
                {
                    var result = collection.GeoNearAs <T>(query, x, y, limit, options);
                    tcs.SetResult(result);
                }
                catch (Exception exc)
                {
                    tcs.SetException(exc);
                }
            });
            return(tcs.Task);
        }
Example #3
0
 public GeoNearResult <TDocument> GeoNearAs <TDocument>(IMongoQuery query, double x, double y, int limit, IMongoGeoNearOptions options)
 {
     return(_collection.GeoNearAs <TDocument>(query, x, y, limit, options));
 }