incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Suraj Kumar <suraj.ku...@inmobi.com>
Subject Duplicate fields in documents
Date Wed, 19 Feb 2014 12:55:11 GMT
Hi,

If we put documents with same field name twice, we see both keys together
in the document.

suraj@laptop:~ $ curl -d '{"_id":"doc","key":"value","key":"value"}' -X PUT
http://mydbhost:5984/test/doc
{"ok":true,"id":"doc","rev":"1-49200ce1b14d686a961d10af01026cf8"}
suraj@laptop:~ $ curl http://mydbhost:5984/test/doc
{"_id":"doc","_rev":"1-49200ce1b14d686a961d10af01026cf8","key":"value","key":"value"}

This seems wrong. While JS engines (node as well as mozjs) seem to be
correctly 'overwriting' the key, why is couch storing everything? Is this a
bug?

Or am I wrong? (I'm using version 1.4.0)

Regards,

  -Suraj

-- 
An Onion is the Onion skin and the Onion under the skin until the Onion
Skin without any Onion underneath.

-- 
_____________________________________________________________
The information contained in this communication is intended solely for the 
use of the individual or entity to whom it is addressed and others 
authorized to receive it. It may contain confidential or legally privileged 
information. If you are not the intended recipient you are hereby notified 
that any disclosure, copying, distribution or taking any action in reliance 
on the contents of this information is strictly prohibited and may be 
unlawful. If you have received this communication in error, please notify 
us immediately by responding to this email and then delete it from your 
system. The firm is neither liable for the proper and complete transmission 
of the information contained in this communication nor for any delay in its 
receipt.

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