-
i create a new instance in database, there are two fields: the first is filled by |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
That's because With |
Beta Was this translation helpful? Give feedback.
default: Date.now()
vsdefault: () => Date.now()
ordefault: Date.now
?That's because
default: Date.now()
sets the default to the current value ofDate.now()
. So equivalent toDefault: 1710793129346
. Basically you're setting the default value to your server's start time.With
default: () => Date.now()
, you're settingdefault
to a function that Mongoose executes to get the default each time.