How can i write in NodeJS with MongoDB the following MySQL Select?

You can use Mongoose, it help you to work with MongoDB easier.

Record.findOne({
    ip: ipAdress,
    filename_full: filename
}).sort({
    'pieces': -1
}).exec(function(err, doc) {

});

Reference: Mongoose doc , Get max value in mongoose

Browse More Popular Posts

Leave a Comment