覆盖望远镜(流星)中定义的模式

时间:2015-12-16 07:47:49

标签: mongodb meteor telescope

我目前正在大量定制望远镜,这是用Meteor编写的。

我需要查看来自Telescope Posts架构body README.txt定义的here中定义的3,000个字符。

我已经能够自定义HTML和JS,但不能自定义模型。我该怎么做?

1 个答案:

答案 0 :(得分:3)

只需在lib文件夹下创建一个文件,然后使用此处的文档:http://docs.telescopeapp.org/docs/custom-fields删除或添加该模式的字段。

编辑:很抱歉,但仔细阅读您的评论我明白您想要修改autoForm道具而不是Schema本身。要更改允许的最大值,请按以下方式执行操作:

Posts.removeField("body");
Posts.addField({
  fieldName: 'body',
  fieldSchema: {
    type: String,
    optional: true,
    max: 5000,
    editableBy: ["member", "admin"],
    autoform: {
      placeholder: 'Cannot exceed the maximum length of 5000 characters',
      row: 10,
      type: 'textarea'
    }
  }
});