tags:

views:

79

answers:

3

Hi

I have a registration page which asks the user to enter a username and email address.

I need to check to see if the username + email is available. How to do I do this with just one http request.

BTW: the username is used as the docID.

What I'm doing right now is check to see if the docID exists, then using a view to check for the availability of the email address. But that's 2 http requests.

I thought about using a view to emit [ username, email ] as the key and query the view with a "key" param = [ username, email ]. But this won't work if the username and email belong to different existing users.

Thanks

A: 

This question has already been asked and answered: http://stackoverflow.com/questions/2769716/select-users-in-couchdb/2770144#2770144

Please modify your question if you feel it's different in some way.

Cheers.

Sam Bisbee
A: 
jhs
P.S. Do you really own [email protected]? Lucky bastard! :p
jhs
A: 

Hi

I understand Sam's solution is helpful and that is actually what I was using.

@jhs

Thanks for tip for using email address to login.

BTW: Unfortunately [email protected] isn't mine :(

Jason

Jason