Background:
So I'm creating an admin package for meteor 1.4.2 with react so I can learn how to do that sort of thing. The admin package will just be able to update user defined collections (insert, delete, modify).
I have this file in my application under imports/api/posts.js
:
// imports/api/posts.js
import { Meteor } from 'meteor/meteor';
import { Mongo } from 'meteor/mongo';
export const Posts = new Mongo.Collection('posts');
if (Meteor.isServer) {
Meteor.publish('posts', function postsPublication() {
return Posts.find();
});
}
I can easily access this file within my application using for example import { Posts } from '../imports/api/posts.js';
.
Problem:
How can I access the same Posts
collection from within the admin package so I can insert a new item, remove one, etc?
Also, I saw this post earlier about a similar thing, but does that mean packages such as yogiben:admin don't work with the module system either?