使用Insertmany创建新集合,而是将其插入现有集合



需要将对象数组添加到现有集合中。使用此代码:

                    catModel.insertMany(jsonRow,  function(err, videos) {

Catmodel内部具有属性模型名称:" Yoga-Videos-Source"在Mongo中有" Yoga-Videos-Source"。

问题:在插入对象插入后,添加了不添加到" Yoga-Videos-source"中,而是用名称" Yoga-Videos-sources"创建新集合(最终带有前缀-s)。

问题我如何解决此问题?为什么会发生?

集合具有诸如:" Yoga-Videos-Source"之类的主要问题。Mongo有特定的名称公约,因此名称应该是:" Yoga-Videos-Sources"

1)没有上层案例2)结束应为" -s"

最新更新