Values in v:2 index key pattern cannot be of type object

    技术2023-11-14  68

    Mongorestore还原遇到的问题

    错误提示:Mongorestore: createIndex error: Values in v:2 index key pattern cannot be of type object. Only numbers > 0, numbers < 0, and strings are allowed

    原因:导出时候的MongoDB版本和还原的版本不一致导致。导出时候用的4.2版本,导入用的4.0

    解决办法:用同版本MongoDB导入即可

    Processed: 0.010, SQL: 10