Hey guys,
Something weird is happening!
When I try to run operations (find, insert…) with my collections on meteor mongo
I get an error message:
2018-12-20T16:14:30.894-0200 E QUERY [js] ReferenceError: Rooms is not defined :
@(shell):1:1
(“Rooms” is the collection’s name)
All my collections are empty (nothing has been stored in it). I tried meteor reset
, but it still doesn’t work.
I also tried to put the collection on the window object, with no success.
My collections.js file is in /lib and has the following structure:
import { Mongo } from 'meteor/mongo';
import SimpleSchema from 'simpl-schema';
import '../imports/api/methods.js';
export const Rooms = new Mongo.Collection('rooms');
const RoomsSchema = new SimpleSchema({
name: {
type: String
},
type: {
type: String
}
});
Rooms.attachSchema(RoomsSchema);
Any idea what could be happening?