/ lib / collection.js
import { Mongo} from 'meteor/mongo';
export const Chats = new Mongo.Collection('chats');
/ server / app.js
import { Chats} from '../lib/collections';
const chats = [
{
text: 'You on your way?',
},
{
text: 'Hey, it\'s me',
},
{
text: 'I should buy a boat',
},
{
text: 'Look at my mukluks!',
},
{
text: 'This is wicked good ice cream.',
}
];
chats.forEach(function(chat)
{
Chats.insert(chat);
})
/ client / index.js
import { Meteor } from 'meteor/meteor';
import {Chats} from '../lib/collections'
console.log(Chats.find());
Почему Chats.find()
возвращает пустой объект?
Автоопубликация не была удалена.Так что я не могу получить ошибку.