You have two Patient Docs, Patient1 and Patient2 which have embedded Indentifier Docs. Below are the Two Docs { "_id": "1234", "_rev": "123456", "name": "Patient 1", "gender: "MALE", "indentifier": [ {"_id": "abc", "name": "nationalID"} ] } { "_id": "5678", "_rev": "788748", "name": "Patient 2", "gender": "FEMALE", "indentifier": [ {"_id": "abc", "name": "nationalID"} ] } According to the CouchDB spec if the attribute is named _id you can not have duplicates of that attribute in the DB. But in this case you where able to save the indentifier value of the both Patient 1 and Patient 2 using the same _id value "abc". According to CouchDB this is supposed to generate a conflict of duplication because of the _id, but it is not happening. So what is going on here. You are basically try to make indentifier unique across all patient documents, since there is no way of making an attribute unique in CouchDB. >>> Dave Cottlehuber 09/17/10 11:23 AM >>> Hi Babawala If you are creating your own UUIDs or using the system generated one, doc.id should be enforced as unique. what exactly is being duplicated - got an example? A+ Dave On 17 September 2010 20:41, BABALWA MAGALELA <208179585@cput.ac.za> wrote: > My group and I have created a medical record system. The problem is, in > the patient class, when we try to have unique ID's to identify the > patients with, we saw that dupication of that "unique" key is possible. > Could someone refer me so any solution? > -------------------------------------------------------------------- > Disclaimer > This e-mail transmission contains confidential information, > which is the property of the sender. > The information in this e-mail or attachments thereto is > intended for the attention and use only of the addressee. > Should you have received this e-mail in error, please delete > and destroy it and any attachments thereto immediately. > Under no circumstances will the Cape Peninsula University of > Technology or the sender of this e-mail be liable to any party for > any direct, indirect, special or other consequential damages for any > use of this e-mail. > For the detailed e-mail disclaimer please refer to > http://www.cput.ac.za/email.php or call +27 (0)21 460 3911 > -------------------------------------------------------------------- Disclaimer This e-mail transmission contains confidential information, which is the property of the sender. The information in this e-mail or attachments thereto is intended for the attention and use only of the addressee. Should you have received this e-mail in error, please delete and destroy it and any attachments thereto immediately. Under no circumstances will the Cape Peninsula University of Technology or the sender of this e-mail be liable to any party for any direct, indirect, special or other consequential damages for any use of this e-mail. For the detailed e-mail disclaimer please refer to http://www.cput.ac.za/email.php or call +27 (0)21 460 3911