Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Cannot read property 'collection' of undefined #10

Open
chompomonim opened this issue Jan 2, 2016 · 3 comments
Open

TypeError: Cannot read property 'collection' of undefined #10

chompomonim opened this issue Jan 2, 2016 · 3 comments

Comments

@chompomonim
Copy link

I'm getting this error right after adding:

Admin.collections.add('News');

I'm adding it to the end of my news_collection.js file:

News = new Mongo.Collection('news');

News.attachSchema(
  new SimpleSchema({
    title: {
      type: String,
      max: 80
    },
    content: {
      type: String,
      autoform: {
        adFieldInput: {
          type: 'textarea',
          rows: 4
        }
      }
    },
    owner: {
      type: String,
      regEx: SimpleSchema.RegEx.Id
    }
  })
);

Admin.collections.add('News');
@noahsw
Copy link

noahsw commented Jan 11, 2016

As a workaround, it looks like the second argument of Admin.collections.add() is required. Use {} if you want default options.

@MichaelJCole
Copy link

Hey, you might want to update the README with this. It makes the project look unmaintained.

@yogiben
Copy link

yogiben commented Mar 9, 2016

Thanks @MichaelJCole

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants