Hello, I am very new to MongoDB. google this mongoexport syntax but couldn’t get it work on powershell. Not sure what I did wrong. thanks in advance. My server is windows 2016 , powershell 5.1.
mongoexport --collection=<collection_name> --db=<db_name> --out=D:\out.json --query= ‘{“createdAt”: {"$lt": {"$date": new Date(1597261765739)}}}’
I got this error “too many positional arguments: [{ createdAt: {: {: new Date(1597261765)}}}]”.
I also tried
‘{“createdAt”: {"$lt": {"$date": “2020-02-28T00:00:00.000Z”}}}’ and
“{“createdAt”:{”$gte": new Date(1597261765739}}}"… they all end up with same error
The createdAt has value like this in the collection
“createdAt” : ISODate(“2020-04-13T23:01:01.560+0000”)
Not sure what I did wrong here.