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

Updating Grounded Collection + syncing with server #206

Open
vv001 opened this issue Jan 15, 2018 · 0 comments
Open

Updating Grounded Collection + syncing with server #206

vv001 opened this issue Jan 15, 2018 · 0 comments

Comments

@vv001
Copy link

vv001 commented Jan 15, 2018

Hello,

I am currently able to retrieve a number of Orders by use of following method and store it in a Grounded Collection:

public initGroundedCollectionOrders() { if(Meteor.isClient) { console.log('METEOR IS CLIENT'); this.newOrders = new Ground.Collection('orders', { cleanupLocalData:false }); this.newOrders.observeSource(Orders.find()); Meteor.subscribe('orders', { onReady() { this.newOrders.keep(Orders.find({},{reactive: true})); } }); this.newOrders.once('loaded', ()=> {console.log('loaded'); }); } }

I want to update the status of an order which is stored in "this.newOrders". I do it by the following:

public updateGroundedOrder(orderid: number, status: string) { this.newOrders.update({ _id: orderid }, { $set: { status: status } }); }

This seems to update the order in the Grounded collection, but doesn't sync it with the server. How can I make sure that when the specific order in the Grounded Collection 'orders' is updated, it in turn is synced and updated on the server side?

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

1 participant