Open HyuOniichan opened 1 day ago
Problem Can't access to createdAt (automatically added when using timestamps: true in mongoose)
Reproduce backend > models > blogModel.js timestamps: true
frontend > src > components > blogComponents > BlogList.js fetch data
console window
api: http://localhost:8000/v1/blog No sign of createdAt or updatedAt field
Expected Can access to createdAt field to make 'published date' for blog
Reason The data in MongoDB is manually created through Atlas, and the timestamps is not auto generated, it is created through mongoose instead.
Fixed Insert later in future
Problem Can't access to createdAt (automatically added when using timestamps: true in mongoose)
Reproduce backend > models > blogModel.js timestamps: true
frontend > src > components > blogComponents > BlogList.js fetch data
console window
api: http://localhost:8000/v1/blog No sign of createdAt or updatedAt field
Expected Can access to createdAt field to make 'published date' for blog