0

I have a client only collection

feedComments=new Mongo.Collection('feeds');

Using meteor composite I'm publishing few records to this collection,

when I try to update the collection in client

feedComments.update({_id:result._id},{$set:{name:"xxx"}});

It is not allowing me to it is throwing error

method not found

why can't I insert or update the client only collection,why do client collections don't have those methods?

don't know this can be done,but I tried with this too

feedComments.allow({
    insert: function (userId, doc) {
        return true;
    },
    update: function (userId, doc, fields, modifier) {
        return false;
    },
    remove: function (userId, doc) {
        return false;
    }
 });
user555
  • 1,489
  • 2
  • 15
  • 28
  • i guess you defined collection in variable `feeds` and you are acceesing with `feedComments` – ajduke Jan 28 '15 at 11:42
  • @ajduke that's typo mistake – user555 Jan 28 '15 at 11:46
  • okay. In your declaration, are you trying to define client-only collection? – ajduke Jan 28 '15 at 11:57
  • yes,that is my question – user555 Jan 28 '15 at 11:59
  • 1
    okay, try define client-only collection like this- `feedComments=new Mongo.Collection(null);`. Observe `null` passed – ajduke Jan 28 '15 at 12:00
  • I'm following this blog http://braindump.io/meteor/2014/09/20/publishing-to-an-alternative-clientside-collection-in-meteor.html, it shows name so I followed, if it gives null, it is working thanks for the help. The answer by @Sasikanth worked too. – user555 Jan 28 '15 at 12:06

1 Answers1

2

to perform crud operations on client only collections user _collection

try

feedComments._collection.update({_id:result._id},{$set:{name:"xxx"}});
Sasikanth
  • 3,045
  • 1
  • 22
  • 45