MeteorToys / meteor-devtools

Insanely Handy Development Tools for Meteor
http://meteor.toys
Other
95 stars 7 forks source link

Removing object with same _id as in other collection is not working #82

Closed kulttuuri closed 7 years ago

kulttuuri commented 8 years ago

It seems that when removing (Also probably when trying to update item in collection) meteortoys targets just the _id of the target item and does not take into account the collection. When two items in different collections share the same _id, removing causes this error and cannot remove the item:

Exception while invoking method 'Mongol_remove' MongoError: insertDocument :: caused by :: 11000 E11000 duplicate key error index: meteor.MeteorToys.Mongol.$id dup key: { : "CCRewihvM6EbytbQH" }

msavin commented 8 years ago

Hmm - this is doubtful because AFAIK you can only target documents through the collection.

Can you try to move the Meteor Toys packages to the top of your package list? that tends to fix many issues.

If not, please let me know more about your app (ie. list of packages)

kulttuuri commented 8 years ago

Yep, still here. Steps to reproduce this issue:

1) Create collections collectionOne and collectionTwo. 2) Add into collections document with same id. For ex _id: "testing" 3) Subscribe to those documents in meteor. You can also use autopub to subscribe. 4) Bring up meteor toys in the webpage and try to update or remove either one of those documents in meteor toys. Brings up error. Seems like it is not targeting collection _id but global _id which causes the issue.

EDIT: I was using Mongol Pro for trying to do the update and delete operations. This issue is pretty much Mongol related.

msavin commented 7 years ago

This should now be working with the new Mongol 4.0. Just update the package and you should be good to go :)

Meteor Toys has also been patched up to work in these situations, I will be sending the new keys out shortly.

If you run into any issues, please let me know.