I'm pretty confused with the use of the select
method. This is how I use it, and it's wrong:
Transaction.find({username : user.username}).select('uniqueId', 'confirmation_link', 'item_name', 'timeout', 'username', function(err, txs){
callback(txs);
});
What I'm trying to achieve is simply to select from the transactions in the database the ones with that username and I want to take out just the fields listed in the select
method. Can anyone point out how should I use the select
method? Thanks.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…