【发布时间】:2015-06-24 04:31:36
【问题描述】:
这是我想要做的:
SimpleSchema.FaqSchema = new SimpleSchema
order:
type: Number
autoValue: ->
# somehow increment this by 1
updatedAt:
type: Date
autoValue: ->
new Date
updatedBy:
type: String
autoValue: ->
Meteor.userId()
question: type: String
answer: type: String
不幸的是,Meteor 文档或 simpleschema 文档中没有任何内容解释如何执行此操作。这里有 mongo 文档:http://docs.mongodb.org/manual/tutorial/create-an-auto-incrementing-field/
但是,这并没有真正的帮助。
感谢任何帮助。架构在 coffeescript 中,但可以使用 http://js2.coffee/
进行转换【问题讨论】:
标签: mongodb meteor coffeescript