Date Query in MongoDB

You have some data in MongoDB with date object in them. You want to delete data from certain date, then here it is:-

db.COLLECTION.remove({created_at: {$gt: ISODate('2020-10-22')}})

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.