flow-db-admin
flow-db-admin copied to clipboard
Support for Meteor 1.3
Is there a way to import AdminConfig so that I can use this with Meteor 1.3?
AdminConfig is global in the "eager" folders like lib
, client
and server
. It should work exactly the same way it always has.
Thanks for getting me on the right path @CaptainN. But I have another question.
My schema looks like this
export const Companies = new Mongo.Collection('companies');
Companies.attachSchema(new SimpleSchema({
name: {
type: String,
index: true,
unique: true,
max: 50,
},
member: {
type: Boolean,
defaultValue: false,
},
website: {
type: String,
unique: true,
max: 200,
regEx: SimpleSchema.RegEx.Url,
},
email: {
type: String,
unique: true,
regEx: SimpleSchema.RegEx.Email,
},
phone: {
type: String,
max: 50,
},
adventures: {
type: [String],
minCount: 1,
},
'adventures.$.id': {
type: String,
regEx: SimpleSchema.RegEx.Id,
},
addresses: {
type: [Object],
minCount: 1,
maxCount: 4,
},
'addresses.$.type': {
type: String,
defaultValue: 'location',
allowedValues: ['location', 'mailing'],
},
'addresses.$.street1': {
type: String,
},
'addresses.$.street2': {
type: String,
optional: true,
},
'addresses.$.city': {
type: String,
},
'addresses.$.state': {
type: String,
},
'addresses.$.zipcode': {
type: String,
},
'addresses.$.country': {
type: String,
},
}));
I added the following to the lib/index.js
AdminConfig = {
collections: {
Companies: {},
},
};
In this way, Companies is not really global, but instead needs to be imported like this to be used:
import { Companies } from '../imports/api/companies.js';
I'm new to meteor and learning, but I believe the above slows current best practices for 1.3. Let me know if I'm wrong.
If not, do you have any ideas for how to make this work?
Thanks!
use this
AdminConfig = {
name: 'Parser',
adminEmails: ['[email protected]'],
collections: {
Feeds: {
collectionObject: Feeds
},
Sources: {
collectionObject: Sources
}
}
};