Meteor包PersistentMongo2尝试重复插入

时间:2018-04-10 14:41:32

标签: javascript meteor minimongo

我正在测试meteor-persistent-minimongo2以获取离线数据支持。虽然离线数据功能正常,但我在浏览器控制台上看到一些插入失败的错误:WriteError({"code":11000,"index":0,"errmsg":"E11000 duplicate key error。这些错误是随机发生的,有时它会在一段时间内仅为一条记录提供三条记录等的错误,因为我不断刷新页面。服务器端没有错误,因此这与客户端& minimongo。 我在mycollection.js;

中按如下方式使用了包
export const MyCollection = new Mongo.Collection('mycollection');
if (Meteor.isClient) {
    console.log('Setting Mini Mongo Observer');
    const persistentColl = new PersistentMinimongo2(MyCollection, 'testapp');
}

显然,meteor-persistent-minimongo2会尝试将现有文档插入minimongo。但insert操作的source code似乎是正确的。我在这里想念什么?

0 个答案:

没有答案