-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: mongoexport
-
None
-
Environment:bash
-
2014 Last MCI Iteration
I have the following cmd in bash termial
mongoexport --db fscrap --collection Wall -q "{\$or : [{'insert_time' : {\$gte : new Date(1393624800000)} },{'comments.comment_time' : {\$gte : new Date(1393624800000)}}]}" --out test.json
it returns zero records while in mongo shell I get the result expected ~ 300 records
note that I escaped the $ and
echo "{\$or : [{'insert_time' : {\$gte : new Date(1393624800000)} },{'comments.comment_time' : {\$gte : new Date(1393624800000)}}]}"
returns
{$or : [{'insert_time' : {$gte : new Date(1393624800000)} },{'comments.comment_time' : {$gte : new Date(1393624800000)}}]}
query works in mongo shell
> db.Wall.find({$or : [{'insert_time' : {$gte : new Date(1393624800000)} },{'comments.comment_time' : {$gte : new Date(1393624800000)}}]}).count()
328
SOLVED by downgrading from mongo 2.7.8 (dev version) to stable version 2.6.5
http://stackoverflow.com/questions/27334866/mongodb-mongoexport-or-query-returns-zero-records