couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From faust 1111 <faust...@gmail.com>
Subject Re: Validate uniqueness field
Date Tue, 30 Mar 2010 14:13:42 GMT
It's very frightful for me implement uniqueness in this way
create doc for each uniq field and keep it in actual state when i update docs.

may be better check uniqueness only in application layer?
now i don't think about distribute.

2010/3/28 Jan Lehnardt <jan@apache.org>:
> You need to have two documents with a unique ID each.
>
> Cheers
> Jan
> --
>
> On 27 Mar 2010, at 17:12, faust 1111 wrote:
>
>> but what if i have two unique fields
>>  login
>>  email
>>
>> 2010/3/28 J Chris Anderson <jchris@gmail.com>:
>>>
>>> On Mar 27, 2010, at 4:56 PM, faust 1111 wrote:
>>>
>>>> Hi
>>>>
>>>> In what way i cat implement validation of uniqueness?
>>>> User
>>>>  email: unique
>>>>  login:  unique
>>>>
>>>
>>> You can only have 1 unique field per database. you implement it by using it as
a docid, like
>>>
>>> {
>>> "_id" : "user:unique",
>>>   ...
>>> }
>>>
>>> Chris
>
>

Mime
View raw message