meteor-vue icon indicating copy to clipboard operation
meteor-vue copied to clipboard

Deleting from vue model does not delete from collection

Open ramstein74 opened this issue 9 years ago • 3 comments

hi i have this in my model sync: { 'data3': function() { return Posts.find(); }

and in my html li v-repeat="post: data3" v-on="click:data3.$remove($index)"

when i click the record is gone from the page but remains in the collection.

Isnt "sync" suppose to sync ?

thank you

ramstein74 avatar Jul 30 '15 13:07 ramstein74

Hi @ramstein74, please refer to https://github.com/zhouzhuojie/meteor-vue/issues/2 Actually sync is one way, from Meteor db to view only. We need you to write your own update function to touch the db. It's more secure and flexible to do that.

zhouzhuojie avatar Jul 31 '15 04:07 zhouzhuojie

Sorry to hear that. You should add that notice to the docs. Also sync is not the best word. Call it "Get" Regards

ramstein74 avatar Aug 05 '15 09:08 ramstein74

@ramstein74 You should be deleting from the underlying data source, i.e. Posts.remove(...)

xkjyeah avatar Nov 10 '15 03:11 xkjyeah