incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben SkarsgÄrd <benskarsg...@gmail.com>
Subject Passing permanent changing arguments to a view?
Date Wed, 19 Feb 2014 00:24:19 GMT
Hello!

[Introduction] //skip if you want
My Name is Ben, I'm 34 years old from Germany. I'm developing Apps for iOS
and Ruby Backends.
[/Introduction]

I'm new to couchDB, did some tutorials and really enjoyed working with
couchDB.
But now I'm stuck.

I stored locations (doc) to my couchDB.

e. g.:
{
name: "Location A",
latitude: 52.521156,
longitude: 13.396886
}

Because it's a mobile app, I only want to get docs within a radius of 5km.
But I really don't know how to query this.

Is there a possibility to pass some arguments to a view?
Something like this:

function(doc) {
if (doc.longitude > minLong
&& doc.longitude < maxLong
&& doc.latitude > minLat
&& doc.latitude < maxLat)
emit(doc.name, null);
};

Or should every user create and update his own view?

Thank you very much,

Ben

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message