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?
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?