class AutoTimestampCollection extends Mongo.Collection {
insert(document, ...rest) {
document.createdAt = new Date();
document.createdBy = Meteor.isServer && Meteor.userId();
super.insert(document, ...rest);
}
}
Get error when fixture run
Error: Meteor.userId can only be invoked in method calls or publications.