Hello Experts,
I have the following database and i am trying to export records from it at 15 mins interval.
db.nodeLatestStatus.aggregate( [
… { “$match” : { “nodeName” : “nodexxx”, “type” : “eNodeB” } },
… {“$sort” : {“time” : 1}},
… { “$project” : {“_id” : 0, “nodeName” : 1,“time” : 1,“type”: 1 } }
… ] )
{ “nodeName” : “nodexxx”, “type” : “eNodeB”, “time” : ISODate(“2023-05-22T11:51:28.686Z”) }
{ “nodeName” : “nodexxx”, “type” : “eNodeB”, “time” : ISODate(“2023-05-22T11:51:28.686Z”) }
{ “nodeName” : “nodexxx”, “type” : “eNodeB”, “time” : ISODate(“2023-05-22T11:51:28.686Z”) }
{ “nodeName” : “nodexxx”, “type” : “eNodeB”, “time” : ISODate(“2023-05-22T11:51:28.686Z”) }
{ “nodeName” : “nodexxx”, “type” : “eNodeB”, “time” : ISODate(“2023-05-22T11:51:28.686Z”) }
{ “nodeName” : “nodexxx”, “type” : “eNodeB”, “time” : ISODate(“2023-05-22T11:51:28.686Z”) }
{ “nodeName” : “nodexxx”, “type” : “eNodeB”, “time” : ISODate(“2023-05-22T11:51:28.686Z”) }
{ “nodeName” : “nodexxx”, “type” : “eNodeB”, “time” : ISODate(“2023-05-22T11:51:28.686Z”) }
Type “it” for more
My python code is constructing the below command , however i get 0 records from it.
mongoexport --host=xx.xx.xx.xx --port=27017 --db=test_nodedata --collection=nodeLatestStatus --query=‘{ “time” : { “$gte” : { “$date” : “2023-05-22T11:45:00Z” },“$lte” : { “$date” : “2023-05-22T11:59:59Z” } } }’
node:database> mongoexport --host=xx.xx.xx.xx --port=27017 --db=test_nodedata --collection=nodeLatestStatus --query=‘{ “time” : { “$gte” : { “$date” : “2023-05-22T11:45:00Z” },“$lte” : { “$date” : “2023-05-22T11:59:59Z” } } }’
2023-05-22T16:59:43.654+0200 connected to: mongodb://xx.xx.xx.xx:27017/
2023-05-22T16:59:43.710+0200 exported 0 records
I also tried with the below format but no records.
mongoexport --host=xx.xx.xx.xx --port=27017 --db=test_nodedata --collection=nodeLatestStatus --query=‘{ “time” : { “$gte” : { “$date” : “2023-05-22T11:45:00.000Z” },“$lte” : { “$date” : “2023-05-22T11:59:59.999Z” } } }’
node:database> mongoexport --host=xx.xx.xx.xx --port=27017 --db=test_nodedata --collection=nodeLatestStatus --query=‘{ “time” : { “$gte” : { “$date” : “2023-05-22T11:45:00.000Z” },“$lte” : { “$date” : “2023-05-22T11:59:59.999Z” } } }’
2023-05-22T16:59:43.654+0200 connected to: mongodb://xx.xx.xx.xx:27017/
2023-05-22T16:59:43.710+0200 exported 0 records
Thanks!!