mongoose 报错 throw new Error( + firstPieceOfPath + may not be used as a schema pathname)

在设计数据结构Scheme时,抛出了这么一段错误:

 throw new Error('`' + firstPieceOfPath + '` may not be
  used as a schema pathname');
    ^

Error: `collection` may not be used as a schema pathname

在这里插入图片描述
原因是我在设计字段的时候,输入了collection,也需是跟Scheme文件中的哪个地方重复了,所以只需要将collection 换成别的就行

猜你喜欢

转载自blog.csdn.net/l_ppp/article/details/106129436
今日推荐