Collection doesn't sync on the client(minimongo)

Hi Guys,

I’m working with my first angular2-meteor app. But I’m stuck with this pub/sub problem.

When I do an insert through meteor method the data inserted only in the server mongo.In short the data does not store in client(minimongo).

it only sync when I activate the autopublish.

I hope someone will help me. Here’s the public repo to troubleshoot faster.

Component: https://github.com/kevinklinegargar/ezin/blob/master/client/imports/app/dashboard/channels/channels.component.ts
Github: https://github.com/kevinklinegargar/ezin

So Meteor works with Publications and Subscriptions. It’s a lot to wrap your brain around. Essentially:

  • Meteor Server “Publishes” a “Collection” of your data.

  • Meteor Client requests a “Subscribe” to your server, which will match the publication, containing collections, which have documents, which have values…

Welcome to Meteor, the fun is just beginning. :slight_smile:

1 Like

Autopublish enables pub/sub out of the box. For security reasons, remove autopublish and insecure. You can now publish from your collections and subscribe to that publication on the client depending on the view library you’re using. You can find more info in the Meteor Guide

Yes, I already removed the autopublish and insecure and used publish and subscribe. But the data still not storing in client db. I’m not sure where I did wrong.

I’m able to resolved the issue. The minimongo chrome explorer is not updating automatically. it needs to manually refresh to see the updated data.

That should not be necessary. Could we see your publication and subscription code?