2

I am trying to run this command:

mongodump  --port 27017  -d local -c oplog.rs -q '{ts:{$gt: Timestamp(1578475955, 1)}}' -o /data/dump/inc/ 

but for some reason im getting this error:

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

what's the issue?

2
  • Most likely your json not formatted correctly. Just try to validate using an online validator (probably your keys not quoted). Commented Mar 21, 2021 at 11:51
  • On what JSON it's referring? the oplog right? Commented Mar 21, 2021 at 12:03

1 Answer 1

1

{ts:{$gt: Timestamp(1578475955, 1)}} is JavaScript, not extended JSON. See https://github.com/mongodb/specifications/blob/master/source/extended-json.rst for the extended JSON description.

The correct formulation is {"ts":{"$gt": {"$timestamp":{"t":1578475955, "i":1}}}}.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.