1
I’m with the following entity;
'use strict'
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
var ReviewsSchema = Schema({
name: String,
date: String,
rating: String,
comments: String,
restaurantId: String
});
module.exports = mongoose.model('Reviews', ReviewsSchema);
What I need is to know if I am declaring the date attribute right, if it is not right how I should declare the date attribute?
I am using Node Express with Mongodb.
NOTE: in the Front-End application I will need to use pipe to convert the date, that’s why I’m asking, because I think declaring date as String is not right.
There is a "date" data type in Mongoose. http://mongoosejs.com/docs/schematypes.html
– Lucas Brogni