patternCritical
Mongodump: Unrecognized field 'snapshot'
Viewed 0 times
snapshotfieldmongodumpunrecognized
Problem
I am using mongodump from mongo tools to download a backup of my server. However as I run the command, the command returns "Unrecognized field 'snapshot'".
The full error is:
Mongodump --version returns:
I might need to downgrade my version? Otherwise unsure of where to go from here...
The full error is:
Failed: error reading collection: Failed to parse: { find: "data", skip: 0, snapshot: true, $readPreference: { mode: "secondaryPreferred" }, $db: "xxx" }. Unrecognized field 'snapshot'.Mongodump --version returns:
mongodump version: built-without-version-string
git version: built-without-git-spec
Go version: go1.7.3
os: linux
arch: amd64
compiler: gc
OpenSSL version: OpenSSL 1.0.2g 1 Mar 2016I might need to downgrade my version? Otherwise unsure of where to go from here...
Solution
Add
Example:
http://aug2uag.blogspot.com/2018/08/mongoexport-unrecognized-field-snapshot.html
The Error comes from the mongo snapshot functionality which was introduced in mongo 4.0 (https://docs.mongodb.com/manual/reference/read-concern-snapshot/)
If you use an older mongo client (<4.0) to dump/export a more recent MongoDB you will get the error
Unrecognized field 'snapshot'
Using "forceTableScan" will prevent the snapshot functionality to become active, this you won't get the error
--forceTableScanExample:
mongodump --forceTableScan -d database_name -o target_directoryhttp://aug2uag.blogspot.com/2018/08/mongoexport-unrecognized-field-snapshot.html
The Error comes from the mongo snapshot functionality which was introduced in mongo 4.0 (https://docs.mongodb.com/manual/reference/read-concern-snapshot/)
If you use an older mongo client (<4.0) to dump/export a more recent MongoDB you will get the error
Unrecognized field 'snapshot'
Using "forceTableScan" will prevent the snapshot functionality to become active, this you won't get the error
Code Snippets
mongodump --forceTableScan -d database_name -o target_directoryContext
StackExchange Database Administrators Q#215534, answer score: 145
Revisions (0)
No revisions yet.