meteor-collection-timestampable
meteor-collection-timestampable copied to clipboard
Problem global config with "imports" structure
I use imports
structure like this
/ client
/ common
behaviors.js
/ imorts
api/
collection.js
/ server
Behaviors Config
// Collection Behaviours config
CollectionBehaviours.configure({
timestampable: {
createdAt: 'createdAt',
createdBy: 'createdBy',
updatedAt: 'updatedAt',
updatedBy: 'updatedBy',
systemId: '0'
},
softRemovable: {
removed: 'removed',
removedAt: 'removedAt',
removedBy: 'removedBy',
restoredAt: 'restoredAt',
restoredBy: 'restoredAt',
systemId: '0'
}
});
But don't work, Please help me
You need to make sure that the configure code is imported and run before any calls to attach are made.
Follow my structure, the common/behaviors .js
is run first because it is out of imports
folder.
Could more detail?
Or it mean that I must import config file
on all collection file
.
import '../../common/behaviors.js'
export const MyCollection = new Mongo.Collection('myCollection');
Still don't work