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 8681591D3 for ; Sat, 10 Dec 2011 14:58:11 +0000 (UTC) Received: (qmail 27241 invoked by uid 500); 10 Dec 2011 14:58:09 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 27194 invoked by uid 500); 10 Dec 2011 14:58:08 -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 27186 invoked by uid 99); 10 Dec 2011 14:58:08 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 10 Dec 2011 14:58:08 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of paul.joseph.davis@gmail.com designates 209.85.161.180 as permitted sender) Received: from [209.85.161.180] (HELO mail-gx0-f180.google.com) (209.85.161.180) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 10 Dec 2011 14:58:02 +0000 Received: by ggnq1 with SMTP id q1so5583119ggn.11 for ; Sat, 10 Dec 2011 06:57:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=subject:references:from:content-type:x-mailer:in-reply-to :message-id:date:to:content-transfer-encoding:mime-version; bh=gtyYagHbkBOX/Vd7cdp7CDbmE+Udk17s+cAVuKuB9Bk=; b=iDEs0LTETDql3rI5iclr05HbDua4HRuaTL3MIilZdzHQ3YrmqTQLL4I4nfv/zOFI4f ZgbaGs1dXArR66AbNqSKtb6KZAh60d2gock4yhdkEQalcWObjHl630q+/x2627f5LH5Y mkuJiLpcIwKB5ClAFNOD1jmTB8SA7i7LJA1tw= Received: by 10.236.186.2 with SMTP id v2mr18301561yhm.83.1323529061865; Sat, 10 Dec 2011 06:57:41 -0800 (PST) Received: from [10.43.206.46] (mobile-166-137-136-070.mycingular.net. [166.137.136.70]) by mx.google.com with ESMTPS id i22sm20741968yhm.10.2011.12.10.06.57.39 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 10 Dec 2011 06:57:41 -0800 (PST) Subject: Re: How to get only a field in a document References: <73E990F6-8739-4E25-9C83-02686BB16B7B@sri.com> From: Paul Davis Content-Type: text/plain; charset=us-ascii X-Mailer: iPhone Mail (9A405) In-Reply-To: <73E990F6-8739-4E25-9C83-02686BB16B7B@sri.com> Message-Id: <66F74E9C-2D1F-4E4A-AB75-3D1AAF1DCC44@gmail.com> Date: Sat, 10 Dec 2011 09:57:32 -0500 To: "user@couchdb.apache.org" Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (1.0) Or a view if it's the same field for lots of docs.=20 On Dec 9, 2011, at 8:05 PM, Jim Klo wrote: > if you know the document ID that you're after, then a show function can ha= ndle what you're asking without a view: >=20 > http://guide.couchdb.org/draft/show.html >=20 >=20 > Jim Klo > Senior Software Engineer > Center for Software Engineering > SRI International >=20 >=20 >=20 >=20 > On Dec 9, 2011, at 4:10 PM, jack chrispoo wrote: >=20 >> Hi all, >>=20 >> I am new to CouchDB and I have a question about getting data in documents= . >> I have documents like below: >>=20 >> { >> "field1":"value1", >> "field2":"value2", >> .... >> } >>=20 >> The documents have a lot of fields and in one case I only want to get >> field1 from the documents. I'm wondering if there is a way to avoid getti= ng >> the entire document from CouchDB server because this involves a lot of >> unnecessary data transmission over the network? I tried creating a view >> which emits (doc._id,{"field1": doc.fleid1}), but indexing the view takes= >> really long, and it doesn't seem to improve the performance. So I'm curio= us >> if there is an easier way to get only a field out of a document. >>=20 >> Thanks >>=20 >> jack >=20