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