Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Find All Less Than Equal To In MongoDB


exports.test  = async (req, res, next)=>{
    /*date: {
          $gte:ISODate("2013-11-19T14:00:00Z"),
          $lt: ISODate("2013-11-19T20:00:00Z")
      }
 */

let today = new Date();
 
    let all_users = await User.find({created_at: {$lte: today}}).sort({_id:-1}).countDocuments();
res.render("test1", {docs: all_users});
Source by www.mongodb.com #
 
PREVIOUS NEXT
Tagged: #Find #All #Less #Than #Equal #To #In #MongoDB
ADD COMMENT
Topic
Name
2+7 =