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 B97A448DC for ; Sun, 15 May 2011 21:09:59 +0000 (UTC) Received: (qmail 82824 invoked by uid 500); 15 May 2011 21:09:58 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 82790 invoked by uid 500); 15 May 2011 21:09:57 -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 82782 invoked by uid 99); 15 May 2011 21:09:57 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 15 May 2011 21:09:57 +0000 X-ASF-Spam-Status: No, hits=-2.3 required=5.0 tests=NORMAL_HTTP_TO_IP,RCVD_IN_DNSWL_MED,SPF_PASS,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [128.18.84.113] (HELO mailgate-internal3.sri.com) (128.18.84.113) by apache.org (qpsmtpd/0.29) with SMTP; Sun, 15 May 2011 21:09:51 +0000 Received: from brightmail-internal1.sri.com (128.18.84.121) by mailgate-internal3.sri.com with SMTP; 15 May 2011 21:09:30 -0000 X-AuditID: 80125479-b7c61ae000000cd9-36-4dd0410a093a Received: from mars.esd.sri.com (mars.esd.sri.com [128.18.26.200]) by brightmail-internal1.sri.com (Symantec Brightmail Gateway) with SMTP id 10.B6.03289.A0140DD4; Sun, 15 May 2011 14:09:30 -0700 (PDT) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=us-ascii Received: from [192.168.1.6] (adsl-75-15-145-117.dsl.snlo01.sbcglobal.net [75.15.145.117]) by mars.esd.sri.com (Sun Java(tm) System Messaging Server 6.3-8.05 (built Sep 1 2009; 64bit)) with ESMTPSA id <0LL900HD99FSY700@mars.esd.sri.com> for user@couchdb.apache.org; Sun, 15 May 2011 14:09:29 -0700 (PDT) Subject: Re: fetching data: how to filter? References: From: Jim Klo X-Mailer: iPhone Mail (8F190) In-reply-to: Message-id: <0FE69EE5-B262-49E0-934C-AACBF0CB2242@sri.com> Date: Sun, 15 May 2011 14:09:26 -0700 To: "user@couchdb.apache.org" X-Brightmail-Tracker: AAAAAA== You need to define a view, using the name as at least part of the key or create a list. Then you can filter using the key in a view or some parameter you pass using a list. I suggest taking a look a Max Ogden's talk on CouchDB. It's a great jumpstart for a newbie. http://vimeo.com/18808177 - Jim On May 15, 2011, at 1:34 PM, Alexander Gabriel wrote: > Hi > I want to fetch documents from a CouchDb named evab. The documents include a > field "Typ" and I want to fetch those with Typ = Beobachtung. > > So far I've tried: > > - curl -d "{\"Typ\":\"Beobachtung\"}" -X POST > http://username:secretpassword@127.0.0.1:5984/evab/_bulk_docs?include_docs=true> > Beobachtungen.json > - curl -d "{\"docs\": [{\"Typ\":\"Beobachtung\"}]}" -X POST > http://username:secretpassword@127.0.0.1:5984/evab/_all_docs?include_docs=true> > Beobachtungen.json > - replacing {\"Typ\":\"Beobachtung\"} or {\"docs\": > [{\"Typ\":\"Beobachtung\"}]} with "@TypBeob_Kriterien.json" to circumvent > problems with the windows-command-tool and " or '. > > I consistently get all the data of all the docs in the CouchDb. > > From the documentation I have not understood: > > - _all_docs or _bulk_docs? It seems that both work the same. > - Is ist maybe only possible to filter with keys = _id's? > - Is it possible to fetch the data from a view? > > > Or simply: What is the best way to do it? > > Thanks for help! > > Alexander Gabriel