Current datetime

用于存储当前日期时间的字段

类型为 current-datetime 的字段与 datetime 非常相似,区别在于其值在每次文档保存时都会自动更新。它对于存储文章或帖子的最后修改时间非常有用。

示例

{
  name: "last_modified",
  type: "current-datetime",
}

默认情况下,该字段是用户可编辑的。如果你想将其设置为只读:

{
  name: "last_modified",
  type: "current-datetime",
  attributes: {
    readonly: true
  }
}

可用选项

此字段仅具有通用选项