Return-Path: X-Original-To: apmail-couchdb-user-archive@www.apache.org Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B369C1019E for ; Wed, 19 Feb 2014 00:24:48 +0000 (UTC) Received: (qmail 80793 invoked by uid 500); 19 Feb 2014 00:24:47 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 80727 invoked by uid 500); 19 Feb 2014 00:24:47 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 80719 invoked by uid 99); 19 Feb 2014 00:24:46 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Feb 2014 00:24:46 +0000 X-ASF-Spam-Status: No, hits=4.1 required=5.0 tests=FSL_MY_NAME_IS,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of benskarsgard@gmail.com designates 209.85.216.68 as permitted sender) Received: from [209.85.216.68] (HELO mail-qa0-f68.google.com) (209.85.216.68) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Feb 2014 00:24:40 +0000 Received: by mail-qa0-f68.google.com with SMTP id m5so4277796qaj.7 for ; Tue, 18 Feb 2014 16:24:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=HWm/5b7Cn5g/R2hwMqT7uBbgtoln3gFLhFPqm8DT5CY=; b=j8t66/jEau/4kn2PXJZoj/1NtfFVi9bK9HtZfwCpV0FUytiKLujcXfkadD31uXYyiQ gwR3wiguJz6NHvNTDjOjmCrKKTg7ZQjes5pG48NyNWft+WwC/Y4fiiJDEVqiiMYJVmFg fonO7NPSXwXwOyDs7nO/RlY4BbfiEhea3ZkvaVjWG1qwNDfVstGz9sFbKXasXsUHiLg/ ETZtNwGWdugua+zGWEdXGWerla6G5xJuUiWzvoUQOHHUmmYD25+rklpRUr0vyfaNN8c5 t1N0AS9bsIHludphj6jMF/HyBwQ9WB1Vdjb8mAcR3sJ/EE5xJi+8TWxvMuOp4jX41T1J uBZA== MIME-Version: 1.0 X-Received: by 10.140.98.203 with SMTP id o69mr6189782qge.102.1392769459797; Tue, 18 Feb 2014 16:24:19 -0800 (PST) Received: by 10.229.3.196 with HTTP; Tue, 18 Feb 2014 16:24:19 -0800 (PST) Date: Wed, 19 Feb 2014 01:24:19 +0100 Message-ID: Subject: Passing permanent changing arguments to a view? From: =?ISO-8859-1?Q?Ben_Skarsg=E5rd?= To: user@couchdb.apache.org Content-Type: multipart/alternative; boundary=001a1139849ce7c44604f2b76841 X-Virus-Checked: Checked by ClamAV on apache.org --001a1139849ce7c44604f2b76841 Content-Type: text/plain; charset=ISO-8859-1 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 --001a1139849ce7c44604f2b76841--