Thursday, 1 June 2017

How to remove newest created document in MongoDB collection?

How to remove the latest created document in collection? I am curently using

Reservation.remove({name:req.body.name}, function(err){
                    if(err) throw err;
            });

but it remove all documents with same name.



via JKshort

No comments:

Post a Comment