Meteor &引用;*架构不允许使用;
我对望远镜和流星相当陌生 我添加了一个自定义字段,如下所示:Meteor &引用;*架构不允许使用;,meteor,telescope,Meteor,Telescope,我对望远镜和流星相当陌生 我添加了一个自定义字段,如下所示: Users.addField({ fieldName: 'apiToken', fieldSchema: { type: String, autoform: { group: 'API Token', label: 'Token' }, optional: true, editableBy:
Users.addField({
fieldName: 'apiToken',
fieldSchema: {
type: String,
autoform: {
group: 'API Token',
label: 'Token'
},
optional: true,
editableBy: ["member", "manager", "admin"]
}
});
我得到了要显示在用户设置中的字段,
但每当我尝试输入某个内容并提交时,
它给了我一个错误“apiToken不被模式所允许”
我不确定这是望远镜问题还是流星问题
我需要在MongoDB中编辑模式吗?多亏了
向望远镜添加新字段时,必须在客户端和服务器上声明它
package.js
Package.onUse(function (api) {
// client
api.addFiles([
"strawberry_fields.js"
], "client");
// server
api.addFiles([
"strawberry_fields.js"
], "server");
}
Users.addField({
fieldName: 'Likes strawberries',
fieldSchema: {
type: String,
autoform: {
group: 'Strawberries',
label: 'Strawberries'
},
optional: true,
editableBy: ["member", "manager", "admin"]
}
});
草莓田.js
Package.onUse(function (api) {
// client
api.addFiles([
"strawberry_fields.js"
], "client");
// server
api.addFiles([
"strawberry_fields.js"
], "server");
}
Users.addField({
fieldName: 'Likes strawberries',
fieldSchema: {
type: String,
autoform: {
group: 'Strawberries',
label: 'Strawberries'
},
optional: true,
editableBy: ["member", "manager", "admin"]
}
});