Skip to content

Updating Grounded Collection + syncing with server #206

@vv001

Description

@vv001

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions