Request mongoDb where

38 views
0
  • Hello, I have a little problem with my request mongo. It’s not work.
  • I want delete one object from MongoDb where isVerified=false and createdAt >=(time now)-(time of creation)=>2
  • Thanks for your answers

    var maintenant = new Date();
    
    User.remove({
        isVerified: "false",
        createdAt: (((maintenant - user.createdAt) / 1000 / 60) > 2)
    }, function(err) {
    
    });