skip to Main Content

MongoDB view with dynamic dates

I am trying to create a view for records created/modified in last 24 hours. Is it possible? Tried creating view as below db.createView( "viewname", "sourcecollection", [ { $match: {"modifiedTime":{$gte:new Date(Date.now() - 24*60*60*1000), $lte:new Date()}}}] ) But it translates to static…

VIEW QUESTION
Back To Top
Search