incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexander Uvarov <alexander.uva...@gmail.com>
Subject Re: Validate uniqueness field
Date Tue, 30 Mar 2010 15:32:48 GMT

On 30.03.2010, at 20:49, Andrew Melo wrote:

> On Tue, Mar 30, 2010 at 9:44 AM, faust 1111 <faust451@gmail.com> wrote:
>> Yes its only one way.
>> Why couch don't implement uniqueness in simple way?
> 
> It does implement it in a simple way. You get a unique field. Couch
> makes sure that only one document has that field at a same time.
> 
> Actually, I was just thinking, and someone else can correct me if I'm
> wrong, but you may be able to do ['email','username'] as the _id.
> 
> -Melo
> 

How to make composite keys -- unique login and email:
["login": "john", "email": "doe@example.net"]
["login": "bob", "email": "doe@example.net"]
Both keys are different, but emails are not unique.

How to update value (email or login changed)? Just impossible.

Mime
View raw message