-1

mongodump:

--host hostname:port -u User -p password--authenticationDatabase admin --dbdb_name --collection collection_name –q {db.getCollection('col_name').find({"statement.context.platform":"abc","statement.timestamp":{'$gte':'2016-03-30T00:00:00','$lte':'2016-04-20T23:59:59'}})}"

Error:

Error parsing command line: too many positional options

Mongodb version- 2.6

Racil Hilan
  • 24,690
  • 13
  • 50
  • 55
Aayushi
  • 9
  • 1
  • 1
  • 5

1 Answers1

4
  1. Spaces between arguments are not correct
  2. https://docs.mongodb.com/manual/reference/program/mongodump/#cmdoption--query says:

You must enclose the query in single quotes (e.g. ') to ensure that it does not interact with your shell environment.

and your query doesn't have starting qoute, but it ends with double quote.

Hope that this helps.

hp10
  • 602
  • 6
  • 11