-
Type: Task
-
Resolution: Unresolved
-
Priority: Minor - P4
-
None
-
Affects Version/s: 3.4.9, 3.6.1
-
Component/s: mongorestore
-
5
-
1,886
TOOLS-1234 created options to rename namespaces during restore but it doesn't seem to play well with restoring from stdin:
mongodump -d agg -c rollup -q '{item:"Chair"}' -o - | mongorestore --nsFrom 'agg.rollup' --nsTo 'test.rollup' --dir - 2017-12-28T10:29:33.830-0500 writing agg.rollup to stdout 2017-12-28T10:29:33.831-0500 Failed: cannot restore from stdin without a specified collection 2017-12-28T10:29:33.840-0500 Failed: error writing data for collection `agg.rollup` to disk: write /dev/stdout: broken pipe
But using -d and -c yields a warning about deprecation:
mongodump -d agg -c rollup -q '{item:"Chair"}' -o - | mongorestore -d test -c rollup --dir - 2017-12-28T10:26:57.282-0500 the --db and --collection args should only be used when restoring from a BSON file. Other uses are deprecated and will not exist in the future; use --nsInclude instead
Plus how is using --nsInclude going to help when I want to rename?