Closed thearabbit closed 7 years ago
Well, let's wait till 1.5 release is out and we can check if it works there. thanks for the info
Can you anyway provide more informaton about what "Don't work" means?
my structure
// imports/api/posts/posts.js
import {Mongo} from 'meteor/mongo';
import SimpleSchema from 'simpl-schema';
import {Tracker} from 'meteor/tracker';
const Posts = new Mongo.Collection('posts');
Posts.schema = new SimpleSchema({
name: {
type: String,
...........
Posts.attachSchema(Posts.schema);
export default Posts;
----------------------
// imports/api/posts/server/hook.js (imported in server)
import 'meteor/matb33:collection-hooks';
import Posts from '../posts';
Posts.before.insert(function (userId, doc) {
console.log('hook running');
});
But don't work when I tried insert data
I think you are misusing the package.
Can you show me your .meteor/versions
file?
The package should be added globally as a meteor package, and you don't need to import it in any file. This package is changing the Mongo.Collection
(extending it with the functionality)
Oh, I find the error.
Bc I use Collection.upsert
!!!
I tried to use this in
METEOR@1.5-beta.13
, but don't work.