meteor-persistent-minimongo2
meteor-persistent-minimongo2 copied to clipboard
Upsert not working (of course)
I implemented some upsert like this:
if(!c.update()) c.insert()
Since the storage is not yet loaded on pageload, this will always trigger an insert
and the ids are not collected in the Forage correctly (maybe some other bug).
My workaround is using the refresh callback for delaying the upsert:
upsert_delayed(data) {
local_observer.refresh(false, () => {
upsert(data)
})
}