Collection.insert not working

I have a collection defined in lib/collections.js:
mainCollection = new Mongo.Colleciton("maincollection")

When I try to do mainCollection.insert({'user': 'test'}) in a Meteor method on the server side, I get the error that mainCollection.insert is not a function.

I have autopublish and insecure removed if that adds any information.

I’m not sure why it didn’t work before but I created a new method function and put the same exact code in it and it worked. Weird but at least it worked.