incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simon Metson <>
Subject Re: Validate uniqueness field
Date Tue, 30 Mar 2010 15:12:06 GMT

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

Even if you can't you can hash/concatenate the two to make a unique  
string. You could then store the two fields in the doc (for easy  
access in views) and have a validation function to stop people editing  
them. We do something similar (though the id is made of run, lumi and  
md5(dataset), and we're yet to add the validation function), it works  
well for our problem.

View raw message