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.

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

Read more here:

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: