You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Ashraf Janan <as...@yahoo.com> on 2013/10/08 12:20:54 UTC

usrname ppassword

Hi sir,
I tried to send request to couchDb, to get the id for a user,
I did the following:

http://url/DB name/_design/name of design doc/_view/?studentname=name&password=pass

function(doc) {
if(doc.type === "student")
  emit({studentname:name,password:doc.password}, doc);
}

What is the wrong ?please

Best wishes
Ashraf

Re: usrname ppassword

Posted by Хрусталев Евгений <eu...@gmail.com>.
Your map function wont be called when you send request to the couchdb.
Couchdb calls it earlier.

Your map function can be:

function(doc) {
  if(doc.type === "student") {
    emit(doc.name + "_" + doc.password, doc)
  }
}

and your request:

http://url/DB name/_design/name of design doc/_view/?key=name_pass


2013/10/8 Ashraf Janan <as...@yahoo.com>

> Hi sir,
> I tried to send request to couchDb, to get the id for a user,
> I did the following:
>
> http://url/DB name/_design/name of design
> doc/_view/?studentname=name&password=pass
>
> function(doc) {
> if(doc.type === "student")
>   emit({studentname:name,password:doc.password}, doc);
> }
>
> What is the wrong ?please
>
> Best wishes
> Ashraf




-- 
--
С уважением,
Хрусталев Евгений