1 year ago

#188421

test-img

Sam

MongoDB sharded cluster : using a query option for mongoexport utility and mongo version V5.0.6

Using Windows 10 home CMD:

mongoexport --uri="mongodb+srv://cluster0.80g0y.mongodb.net/reporting" --username=quser --authenticationDatabase=admin --password=sample123 --collection=pReports --query "{'index':3}" --out=personsatlas.json

I tried in most of the ways as document suggested, still not able to execute it right. So need input on the query option. My mongo --version is 5.0.6.

I tried --query "{'index':3}", --query '{"index":3}' with equal to sign in between and without .

errors are

  1. Failed: error parsing query as Extended JSON: invalid JSON input with --query "{'index':3}"

  2. query '[39 123 105 110 100 101 120 58 51 125 39]' is not valid JSON: json: cannot unmarshal string into Go value of type map[string]interface {}; with --query='{"index":3}'

=== C:\Users>mongoexport --version mongoexport version: 100.5.2 git version: e2842eb549308c16e070fb2e197d4631cfd085cb Go version: go1.16.7 os: windows arch: amd64 compiler: gc

mongodb

utility

mongoexport

0 Answers

Your Answer

Accepted video resources