Mongoose use of .select() method

前端 未结 9 1658
孤城傲影
孤城傲影 2020-12-14 14:16

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}).sele         


        
9条回答
  •  孤城傲影
    2020-12-14 15:02

    this is another way: queries in mongoose

    Transaction.find({username : user.username})
    .select('uniqueId confirmation_link item_name timeout username')
    .exec(function(err, txs) {
            console.log(txs);
    });
    

提交回复
热议问题