mongoose find returning all rows

24 views
Skip to first unread message

Edward Varghese

unread,
Jul 5, 2016, 3:07:32 AM7/5/16
to Mongoose Node.JS ODM
On using mongoose find with a condition such as 

var condition= $and:[{'Credentials.UserName' :  'param.uName'}, {'Credentials.Password' : 'param.Pwd'}]

Here param.uName and param.Pwd are actual values entered by the user, which is set within inverted comma programatically.

Its returning all records in the mongodb table.

On using .findOne({condition},schema,(err,data){
res.send(data)
})
It always returns the first row.

I am sure that am missing something. Where is it/What is it?

Am new to mongoose. Thanks in Advance.
Edward

Benerjee G

unread,
Sep 21, 2016, 2:01:42 AM9/21/16
to Mongoose Node.JS ODM
Hi Edward Varghese,
I am facing the same issue, do you find any mistake if then please let me know
Reply all
Reply to author
Forward
0 new messages