I have been working on a simple duplicate email submission, here it is:
var filter = function (o) { // o.email query - already submitted query a@a.com
return o.email === email; // passing a@a.com or awe@awe.com
};
db.one(filter, function(email) { // function not picking up callback
if (email == null) { //same - callback returns null
error.add('duplicate');
self.json(error);
return;
}
/....other code .../
});
How could I get the result of the callback?