【MongoDB】 恢复数据库的时候 Failed invalid character '\x00' looking for beginning of value

本文详细介绍了在使用MongoDB的mongorestore命令时遇到的错误:“db”和“collection”参数仅用于从BSON文件恢复,其他用法已弃用,并提供了解决方案,包括修改metadata.json文件和使用–noOptionsRestore参数。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

错误:

2019-04-16T20:09:07.406+0800    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
2019-04-16T20:09:07.442+0800    building a list of collections to restore from C:\Users\bo\Desktop\test dir
2019-04-16T20:09:07.449+0800    reading metadata for at.._products from C:\Users\bo\Desktop\test\._products.metadata.json
2019-04-16T20:09:07.450+0800    Failed: at.._products: error parsing metadata from C:\Users\bo\Desktop\test\._products.metadata.json: invalid character '\x00' looking for beginning of value

解决办法:

方法1:修改metadata.json文件,将属性去掉;
方法2:在执行mongorestore命令的时候加上–noOptionsRestore参数

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值