Answer the question
In order to leave comments, you need to log in
How to properly specify date format in MongoDB?
Good afternoon!
I create a database:
var RoomSchema = new mongoose.Schema({
created: {
type: Date,
default: Date.now
}
});
Answer the question
In order to leave comments, you need to log in
Mongoose returns a perfectly normal Date object . You can format the output yourself:
Or use ready-made modules like this .
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question