Pat*_*zlo 28 mongodb mongorestore mongodump
我收到以下错误(转储MongoDB 3.2)(恢复MongoDB 3.4):
Failed: ngivr-dev.ledgerhelpers: error creating indexes for ngivr-dev.ledgerhelpers: **createIndex error:** **The field 'safe' is not valid for an index specification.** Specification: **{ unique: true, name: "ledgerId_1", safe: null, ns: "ngivr-dev.ledgerhelpers", background: true, key: { ledgerId: 1 } }**
Run Code Online (Sandbox Code Playgroud)
看起来安全索引为null.但是我如何在MongoDB 3.4中使用它?3.2没关系.
ser*_*iuz 57
safe=true
不是索引规范.
在早期版本的MongoDB中,低于3.4,可以添加额外的索引规范.那些被特定的司机使用.
在3.4中,mongodb添加了对索引规范的验证:
这就是你有这个错误的原因.我担心您需要确保3.2版本中的索引没有无效的索引规范,然后执行mongodump.
正如kz_sergey在他的回答中所说,你可以mongorestore
使用--noIndexRestore
,这应该可以正常工作.
归档时间: |
|
查看次数: |
14936 次 |
最近记录: |