I'm trying to query my DB for users, but nothing happens when I try.
Here is my code to query the DB:
console.log("before db.user");
db.user.find({steamid: userSteamId}, function(err, user){
if(err || !user){
console.log("No account found, prompt for tradelink to create acct");
//createUser(userSteamId, tradelink);
} else user.forEach( function(tradelink){
console.log(tradelink);
});
});
console.log("after db.user");
Here is the console output:
before db.user
after db.user
There are no error messages, and neither the if, nor the else console.log statements are echoed to the console. What's wrong here, and is there any way I can see the responses from my query?
try to log user before iterating it. it might be empty in that case your query is wrong or there is no matching data in the database.