Timestamps
Timestamps are output-only fields that ivo populates automatically. Enable them
with the timestamps schema option.
Default behavior
With timestamps: true, ivo adds createdAt and updatedAt to every created
or updated entity.
Loading playground…
Custom keys
Use an object to rename the fields. updatedAt can also be configured as
non-nullable.
new Schema((b) => ..., {
timestamps: {
createdAt: "created_at",
updatedAt: { key: "updated_at", nullable: false },
},
});
Rules
- Timestamps are ignored if provided as input.
createdAtis set once, during creation.updatedAtis set during creation and refreshed on every successful update.- Setting
updatedAttofalsedisables the update timestamp while keepingcreatedAt.