socket.on('login', function (details) {
dbHandle.collection('Users', function(err, logins) {
if (err) throw err ;
logins.findOne({'user': details.User, 'pwd': details.Pass }, function(err, record) {
if (err) {
console.log('Oops!') ;
socket.emit('error', { error: 'Oops'} ) ;
}
else
{
// I always get this returned to client!
socket.emit('login', {data: 'record'} ) ;
}
});
}) ;
}) ;
--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.
For other MongoDB technical support options, see: http://www.mongodb.org/about/support/.
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user...@googlegroups.com.
To post to this group, send email to mongod...@googlegroups.com.
Visit this group at http://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/225ff047-ac8b-4b90-94e2-54d3b706e5c6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
I am aware of the laziness which is why I was expecting MongoDB to throw an error when it tried to search. But having said that if the collection is then created lazily then there is something to search isn't there!
So apart from my 'record' being null is there any way to determine if a search fails?