简体   繁体   中英

Unrecognized operator: $geoIntersects

I am running this query and I am getting : "Uncaught Error: Unrecognized operator: $geoIntersects"

RestPolygons.findOne({restRefId: 'Fsmbi94HahsRJH9rT', zoneCoordinates: {$geoIntersects:
                    {$geometry:{ "type" : "Point",
                        "coordinates" : [34.7791114, 32.077278299999996]}
                    }
                }})

If I replace $geoIntersects with $geoWithin, i get "Unrecognized operator: $geoWithin"

https://docs.mongodb.com/manual/reference/operator/query/geoIntersects /

RestPolygons.find(
       {
         loc: {
           $geoIntersects: {
              $geometry: {
                 type: "Polygon" ,
                 coordinates: [
                   [ [ 0, 0 ], [ 3, 6 ], [ 6, 1 ], [ 0, 0 ] ] // for use like 
                 ]
              }
           }
         }
       }
    )

It has been added in version 2.4 geoIntersects

Which version of mongo are you running?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM