苏飞论坛

标题: C# MongoDB 查询语句Query.Near的用法 [打印本页]

作者: 站长苏飞    时间: 2014-6-4 14:50
标题: C# MongoDB 查询语句Query.Near的用法
使用访求如下
[C#] 纯文本查看 复制代码
        //
        // 摘要:
        //     Tests that the value of the named element is near some location (see $near).
        //
        // 参数:
        //   name:
        //     The name of the element to test.
        //
        //   x:
        //     The x value of the origin.
        //
        //   y:
        //     The y value of the origin.
        //
        // 返回结果:
        //     An IMongoQuery.
        public static IMongoQuery Near(string name, double x, double y);
        //
        // 摘要:
        //     Tests that the value of the named element is near some location (see $near).
        //
        // 参数:
        //   name:
        //     The name of the element to test.
        //
        //   point:
        //     The point.
        //
        //   maxDistance:
        //     The max distance.
        //
        // 返回结果:
        //     An IMongoQuery.
        public static IMongoQuery Near<TCoordinates>(string name, GeoJsonPoint<TCoordinates> point, double maxDistance) where TCoordinates : GeoJsonCoordinates;
        //
        // 摘要:
        //     Tests that the value of the named element is near some location (see $near).
        //
        // 参数:
        //   name:
        //     The name of the element to test.
        //
        //   x:
        //     The x value of the origin.
        //
        //   y:
        //     The y value of the origin.
        //
        //   maxDistance:
        //     The max distance.
        //
        // 返回结果:
        //     An IMongoQuery.
        public static IMongoQuery Near(string name, double x, double y, double maxDistance);
        //
        // 摘要:
        //     Tests that the value of the named element is near some location (see $near).
        //
        // 参数:
        //   name:
        //     The name of the element to test.
        //
        //   point:
        //     The point.
        //
        //   maxDistance:
        //     The max distance.
        //
        //   spherical:
        //     if set to true then the query will be translated to $nearSphere.
        //
        // 返回结果:
        //     An IMongoQuery.
        public static IMongoQuery Near<TCoordinates>(string name, GeoJsonPoint<TCoordinates> point, double maxDistance, bool spherical) where TCoordinates : GeoJsonCoordinates;
        //
        // 摘要:
        //     Tests that the value of the named element is near some location (see $near).
        //
        // 参数:
        //   name:
        //     The name of the element to test.
        //
        //   x:
        //     The x value of the origin.
        //
        //   y:
        //     The y value of the origin.
        //
        //   maxDistance:
        //     The max distance.
        //
        //   spherical:
        //     if set to true then the query will be translated to $nearSphere.
        //
        // 返回结果:
        //     An IMongoQuery.
        public static IMongoQuery Near(string name, double x, double y, double maxDistance, bool spherical);


上面是方法签名,大家只要输入相应的参数就行了

作者: 夜雨蒙蒙    时间: 2014-6-4 21:25
??????




欢迎光临 苏飞论坛 (http://www.sufeinet.com/) Powered by Discuz! X3.4