Meteor.publish('categories', function (name) {
    return Categories.find({
        name: { $regex: name }
    });
});

Categories.allow({
    insert: function(userId, doc){
        return true;
    },
    update:  function(userId, doc, fieldNames, modifier){
        return false;
    },
    remove:  function(userId, doc){
        return true;
    }
});
Meteor.publish('categories', function (text) {
    return Categories.find({
        $or: [
            {name: { $regex: text }},
            {description: { $regex: text }}
        ]
    });
});

Categories.allow({
    insert: function(userId, doc){
        return true;
    },
    update:  function(userId, doc, fieldNames, modifier){
        return false;
    },
    remove:  function(userId, doc){
        return true;
    }
});
Add description to category search
Add description to category search
