My mongoose Schema as belows:
clothes: [{
_id: {
type: mongoose.Schema.Types.ObjectId,
ref: 'Clothes'
},
dateAdded: {
type: Date,
default: Date.now
}
}],
Now, If I'm pushing any new object into the clothes array within 1 min then it's storing the same date and time.
"clothes" : [
{
"_id" : ObjectId("5e3bcc9434a40d46e7eb2b25"),
"dateAdded" : ISODate("2021-01-05T10:50:19.979Z")
},
{
"_id" : ObjectId("5c0599f6975b274a7654702a"),
"dateAdded" : ISODate("2021-01-05T10:50:19.979Z")
},
{
"_id" : ObjectId("5d8cce493eb29c6e5af6be07"),
"dateAdded" : ISODate("2021-01-05T10:50:19.979Z")
},
{
"_id" : ObjectId("5db8344a1689662efbc6d816"),
"dateAdded" : ISODate("2021-01-05T11:02:47.352Z")
}
]
I really appreciates if you could help me out in this.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…