couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jack chrispoo <jackchris...@gmail.com>
Subject How to get only a field in a document
Date Sat, 10 Dec 2011 00:10:59 GMT
Hi all,

I am new to CouchDB and I have a question about getting data in documents.
I have documents like below:

{
   "field1":"value1",
   "field2":"value2",
   ....
}

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 getting
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 curious
if there is an easier way to get only a field out of a document.

Thanks

jack

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