Reputation: 7521
I'm writing a Meteor package that needs to create a new collection.
NewCollection = new Mongo.Collection('newcollection');
doesn't work in package code because Mongo isn't available to the package (Mongo is not defined
).
How can I create a new collection in a Meteor package?
Upvotes: 0
Views: 26
Reputation: 4091
In your package.js
file just include the mongo
package:
Package.onUse(function (api) {
api.use('mongo');
});
Upvotes: 2