How to take 1 week dump using Query

I have write one query but its not working as JS file. I want to take dump of this find Script.

mongodump --host localhost --port 27017 -d DBname -c Coll --queryPath "Script.js"

using 3.4 Version of MongoDB.

Pls help.

db.getSiblingDB('DBName')
var date=new Date();
date.setDate(date.getDate() - 7);
Date()
db.Collection.find({"_updatedAt":{ $lt: date}});


Read more here: https://stackoverflow.com/questions/67920711/how-to-take-1-week-dump-using-query

Content Attribution

This content was originally published by Yogesh J at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: