ozomer / node-red-contrib-mongodb2

MongoDB driver node for Node-RED
Apache License 2.0
15 stars 19 forks source link

GeohaystackSearch or GeoFind Operation #23

Open rajesindia opened 6 years ago

rajesindia commented 6 years ago

Hello,

Could anyone help me to share a sample flow with Geohaystacksearch and Geofind operation? I had created a document with geojson indexed field. I was able to apply geo filters like geowithin from the mongo query builder. I would like to do the same from mongodb2 node to expose the geospatial queries option as a rest interface.

ozomer commented 6 years ago

Hi, Just look at the native operation: http://mongodb.github.io/node-mongodb-native/2.2/api/Collection.html#geoHaystackSearch . It accepts 3 params: x, y, options (ignore the callback). So you should send it a msg with an array payload of three elements: msg.payload = [x, y, options];.

Regards, Oren