Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed: error parsing query as Extended JSON: invalid JSON input #17

Open
ravi-karan opened this issue Dec 25, 2019 · 2 comments
Open
Labels

Comments

@ravi-karan
Copy link

Rails 5.1.4
2.6.2 :001

db version v4.2.1
git version: edf6d45851c0b9ee15548f0f847df141764a317e
allocator: system
modules: none
build environment:
distarch: x86_64
target_arch: x86_64

mongodump = Mongoid::Shell::Commands::Mongodump.new(collection: 'history_trackers', out: '/Users/ravi/Desktop/Temp', query: '{ "scope": { "$eq": "offer" }, "created_at": { "$gte": { "$date": "2019-12-24T09:36:56.312Z" } } }')

system mongodump.to_s
2019-12-25T21:51:27.779+0530 Failed: error parsing query as Extended JSON: invalid JSON input
=> false

mongodump = Mongoid::Shell::Commands::Mongodump.new(collection: 'history_trackers', out: '/Users/ravi/Desktop/Temp', query: { "scope": { "$eq": "offer" }, "created_at": { "$gte": { "$date": "2019-12-24T09:36:56.312Z" } } })
=> #<Mongoid::Shell::Commands::Mongodump:0x00007fa387045128 @session=#<Mongo::Client:0x70170160720020 cluster=#<Cluster topology=Single[localhost:27017] servers=[#]>>, @collection="history_trackers", @out="/Users/ravi/Desktop/Temp", @query={:scope=>{:$eq=>"offer"}, :created_at=>{:$gte=>{:$date=>"2019-12-24T09:36:56.312Z"}}}>
2.6.2 :012 > system mongodump.to_s
2019-12-25T21:54:59.119+0530 Failed: error parsing query as Extended JSON: invalid JSON input
=> false
Screen Shot 2019-12-25 at 10 00 20 PM

@ravi-karan
Copy link
Author

ravi-karan commented Dec 25, 2019

2.6.2 :013 > mongodump -d=offer_service_db -c=history_trackers -o='/Users/ravi/Desktop/Temp' -q '{ "scope": { "$eq": "offer" }, "created_at": { "$gte": { "$date": "2019-12-24T09:36:56.312Z" } } }'
2019-12-25T22:07:30.576+0530 writing offer_service_db.history_trackers to
2019-12-25T22:07:30.661+0530 done dumping offer_service_db.history_trackers (1 document)
=> ""
2.6.2 :014 >
2.6.2 :015 >

the query is valid Extended JSON

@dblock dblock added the bug? label Dec 26, 2019
@dblock
Copy link
Collaborator

dblock commented Dec 26, 2019

Feels like a bug to me somewhere, but haven't looked deeper. I suggest writing a spec that reproduces this and I am sure we can fix it easily.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants