yogiben / meteor-autoform-file

Upload and manage files with #autoForm
MIT License
92 stars 101 forks source link

remove data #41

Closed YouSour closed 9 years ago

YouSour commented 9 years ago

hi , i'm new here , how can i remove data in database ? thank you for advance .

mpowaga commented 9 years ago

You can read CollectionFS docs.

Using example in meteor-autoform-file you can do it like this:

var pictureId = Posts.findOne().picture;
Images.remove(pictureId);
YouSour commented 9 years ago

hi , could you give example more clearly ? here example code i want :

js:

'click .remove': function () { // remove file image },

collection

Images = new FS.Collection('images', { stores: [new FS.Store.GridFS("images", {})] });

Images.allow({ insert: function (userId, doc) { return true; }, download: function (userId) { return true; }, remove: function (userId) { return true; } });