Meteor package PersistentMongo2 tries duplicate inserts

38 Views Asked by At

I am testing meteor-persistent-minimongo2 for offline data support. Although the off-line data feature is working fine, I see some insert failed errors on browser console: WriteError({"code":11000,"index":0,"errmsg":"E11000 duplicate key error. These errors occur randomly, sometimes it gives error for only one record some other time for three records, etc. as I keep refreshing the page. There is no error on the server side, so this is related with the client & minimongo. I use the package as follows in mycollection.js;

export const MyCollection = new Mongo.Collection('mycollection');
if (Meteor.isClient) {
    console.log('Setting Mini Mongo Observer');
    const persistentColl = new PersistentMinimongo2(MyCollection, 'testapp');
}

Apparently, meteor-persistent-minimongo2 tries to insert an existing document into minimongo. But the source code making the insert operation seems correct. What do I miss here?

0

There are 0 best solutions below