Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with Methods deletetion #39

Closed
pedrolucasoliva opened this issue Jun 18, 2018 · 15 comments
Closed

Problem with Methods deletetion #39

pedrolucasoliva opened this issue Jun 18, 2018 · 15 comments

Comments

@pedrolucasoliva
Copy link

pedrolucasoliva commented Jun 18, 2018

When I delete a record by Meteor Methods, the reactive don't push the update.
When a do something directly in mongodb, it does normally. I forgot some configuration?

@pedrolucasoliva pedrolucasoliva changed the title Problem with Methods deletetion. Problem with Methods deletetion Jun 18, 2018
@pedrolucasoliva
Copy link
Author

Someone pass through this problem? After delete a document at Mongo (Meteor method based), it not comeback with reactive and stuck at my screen. The user think that not "well clicked" and send delete again. Then, Meteor error happens because there is not document to delete. I think thats is some problem whith cache. But I can't resolve. :(

@JcBernack
Copy link
Owner

JcBernack commented Oct 1, 2018

Can you double check that it works when you delete something directly in MongoDB, but doesn't work when you do the same via a Meteor method? That seems odd to me.

@pedrolucasoliva
Copy link
Author

@JcBernack, thank you for your attention.
I did check again. Now, I deleted manually a document at mongodb and it doesn't goes to reactivity.
It's a normal behavior or I missed some configuration?

@JcBernack
Copy link
Owner

Ok, can you show some code of how you use reactive aggregation? Do you use observeSelector or lookupCollections? If you're doing something wrong here the aggregation might miss certain updates.

@pedrolucasoliva
Copy link
Author

pedrolucasoliva commented Oct 2, 2018

I did Meteor downgrade to 1.6.1.4 and works good.

However, my code:
My publication:
Meteor.publish('entities', function () { if (!this.userId) { return; } ReactiveAggregate(this, Entities.collection, [ { $match: { company: Meteor.user().profile.activeCompany, type: { $nin: [EntityType.company] } } }, { $lookup: { from: "users", localField: "user", foreignField: "_id", as: "user" } } ]); });

My Collection:
export const Entities = new MongoObservable.Collection<Entity>('entities');

and my subscription:

this.dataSub = MeteorObservable.subscribe(this.service).subscribe(); this.data = this.collection.find();

@pedrolucasoliva
Copy link
Author

I think that reactive don't works well with npm-mongo 3+.
There are another issues with it: https://github.com/meteor/meteor/issues/9944

@pedrolucasoliva
Copy link
Author

#44 It's related?

@pedrolucasoliva
Copy link
Author

I had try at Meteor 1.8, didnt work too. Sadly I got had to stop at Meteor 1.6.1.3 to keep the Meter Reactive Aggregate working.

@AlanOrtega91
Copy link

Was this issue ever resolved? I´m having the same problem

@pedrolucasoliva
Copy link
Author

Is not. I think it's a problem with the new Mongo drive. I'm keeping METEOR 1.6.1.3 in the production environment.

@Cerealkillerway
Copy link

I have the same problem too... Any news about this one?

@fishsaidno
Copy link

#44 resolves this issue. We have been using that fork as a local package since the release of Meteor 1.7 to keep things moving.

@pedrolucasoliva
Copy link
Author

I forked this repo:
meteor add pedrolucasoliva:reactive-aggregate
This works on.
Thanks @fishsaidno ans @JcBernack.

@castasamu
Copy link

I have same problem!! :(
When I remove an item reactivity doesn't work.

@JcBernack
Copy link
Owner

Closing old issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants