cloudant / nodejs-cloudant

Cloudant Node.js client library
Apache License 2.0
255 stars 90 forks source link

Geo support #101

Closed jhs closed 8 years ago

jhs commented 8 years ago

TBD, just capturing this for now

glynnbird commented 8 years ago

Cloudant GEO is documented here: https://docs.cloudant.com/geo.html

It involves writing design documents to databases which is covered by Nano's db.insert function. Querying an index involves doing a GET to /<database>/_design/<name>/_geo/<geoindexname>?<query-parameters>

So we will want to add the equivalent of db.search for the Geo library e.g.

db.geo(designname, geoindexname, {include_docs: true}, function(err, data) {

});

see https://docs.cloudant.com/geo.html#querying-a-cloudant-geo-index for parameters.

komalda commented 8 years ago

we also needed this feature.

jhs commented 8 years ago

Note, add some documentation about using it in the README

isc-rsingh commented 8 years ago

Is this work complete @jhs? If not I can work on it. Do any of the Cloudant requests implement paging so that the user doesn't have to worry about getting back only the first 200 documents, or was that considered a bad idea?

tomjessessky commented 8 years ago

Hi @rajrsingh, I have a fork with an implementation, I will submit a PR later this week. Not sure about the 200 documents consideration...

isc-rsingh commented 8 years ago

Great! Looking forward to it @tomjessessky

jhs commented 8 years ago

Done in 20df23c