function SearchUser(searchString) {
MongoClient.connect(url, function (err, db) {
if (err) throw err;
db.collection("user").find({ phonenumber: searchString }, function (err, result) {
if (err) throw err;
return result;
db.close();
});
});
}
I want to get the result back but i only get undefined back.