meteor-collection-behaviours icon indicating copy to clipboard operation
meteor-collection-behaviours copied to clipboard

Error trying to use the package

Open rafaelfaria opened this issue 10 years ago • 1 comments

I'm getting the following error when i try to do

Posts = new Mongo.Collection("posts");
Posts.timestampable();
W20150121-10:04:05.296(11)? (STDERR)
W20150121-10:04:05.297(11)? (STDERR) /Users/rcardoso/.meteor/packages/meteor-tool/.1.0.38.z83ibe++os.osx.x86_64+web.browser+web.cordova/meteor-tool-os.osx.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:173
W20150121-10:04:05.297(11)? (STDERR)                        throw(ex);
W20150121-10:04:05.297(11)? (STDERR)                              ^
W20150121-10:04:05.298(11)? (STDERR) TypeError: Object [object Object] has no method 'timestampable'
W20150121-10:04:05.298(11)? (STDERR)     at app/lib/collections.js:8:7
W20150121-10:04:05.298(11)? (STDERR)     at app/lib/collections.js:20:3
W20150121-10:04:05.298(11)? (STDERR)     at /Users/rcardoso/Sites/mine/inutil/.meteor/local/build/programs/server/boot.js:175:10
W20150121-10:04:05.298(11)? (STDERR)     at Array.forEach (native)
W20150121-10:04:05.298(11)? (STDERR)     at Function._.each._.forEach (/Users/rcardoso/.meteor/packages/meteor-tool/.1.0.38.z83ibe++os.osx.x86_64+web.browser+web.cordova/meteor-tool-os.osx.x86_64/dev_bundle/server-lib/node_modules/underscore/underscore.js:79:11)
W20150121-10:04:05.298(11)? (STDERR)     at /Users/rcardoso/Sites/mine/inutil/.meteor/local/build/programs/server/boot.js:86:5

What am I doing wrong?

rafaelfaria avatar Jan 20 '15 23:01 rafaelfaria

See https://github.com/Sewdn/meteor-collection-behaviours/issues/20. Basically, you have to call CollectionBehaviours.extendCollectionInstance {{your_collection}}.

taromero avatar Feb 02 '15 22:02 taromero