Closed JarnoLeConte closed 5 months ago
@raix Could you look into pulling this and publish?
Sorry about the wait @hluz it's vaccation time :) - pr merged and 2.0.0-rc.4
is published
Thanks @JarnoLeConte
Let me know if this is still an issue in 2.0.0-rc.5
We are experiencing same problem in 2.0.0-rc6, but in different code line:
TypeError: Cannot read property '_id' of undefined(…) TypeError: Cannot read property '_id' of undefined at GroundKonetl.saveDocument (http://localhost:3000/packages/ground_db.js?hash=65466264538f340bd5903bdfa757880bdc26690c:264:26) at GroundKonetl.remove (http://localhost:3000/packages/ground_db.js?hash=65466264538f340bd5903bdfa757880bdc26690c:683:12)
The error arises when trying to remove elements from an empty collection.
So we have changed remove function on ground.db.js from line 439 and validating document before saving it as follows:
remove(selector, ...args) { // Order of saveDocument and remove call is not important // when removing a document. (why we don't need carrier for the result) const doc = this._collection.findOne(selector); doc && this.saveDocument(doc, true); return this._collection.remove(selector, ...args); }
@raix could it be included in next release? Or can I make a PR?
@paranoico you are wellcome to do a pr. I'm as always a bit low on time
Pull request done, hope have done it right #188
Thanks a lot @raix
I can't remove documents. I get the following error...
The pending read/write statistics confirm the failure:
If I clear the storage (which works) and insert documents again, the same error occurs when I try to remove them.
edit: I use
METEOR@1.3.3
and create a unmanaged collection likenew Ground.Collection('something');