D
D
dreamniker2016-02-27 10:58:30
meteor
dreamniker, 2016-02-27 10:58:30

How to remove data in collections from client via selectors?

Meteor allows deleting documents from the collection on the client only through ID (Uncaught Error: Not permitted. Untrusted code may only remove documents by ID. [403]), and I would really like to delete data through selectors, can I somehow get around this restriction?
Tried like this:

Banners.allow({
    update:function(userId, doc, fieldNames, modifier) {
        return true
    },
    remove:function(userId, doc){
        return true;
    }
});

You can, of course, through Meteor.methods, or make a selection through find () and then delete with a new request through _id, but it would be more logical to give the ability to delete through selectors in some collections

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question