incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "BABALWA MAGALELA" <208179...@cput.ac.za>
Subject Re: Duplication of unique keys
Date Tue, 21 Sep 2010 06:39:51 GMT
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.



>>> Wout Mertens <wout.mertens@gmail.com> 09/17/10 11:19 AM >>>
On Sep 17, 2010, at 10:41 , BABALWA MAGALELA 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?

How about explaining more about your problem? This isn't enough to find
out what you mean :)

Wout.



--------------------------------------------------------------------
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

Mime
View raw message