Created
January 2, 2020 18:45
-
-
Save thanhtungdp/cb0da8d472445095e921bebe904c2aaf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import mongoose from "mongoose"; | |
var { Schema } = mongoose; | |
var HistoryActionSchema = new Schema({ | |
userId: String,// driver id | |
tripId: { | |
type: String, | |
unique: true, | |
required: true, | |
}, | |
typeAction: Number, | |
description: String, | |
appMode: String, // production or development | |
createdTime: Number, | |
updatedTime: Number, | |
}); | |
HistoryActionSchema.virtual('id').get(function () { | |
return this._id; | |
}); | |
HistoryActionSchema.set('toJSON', { virtuals: true }); | |
export default mongoose.model('history_action', HistoryActionSchema); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment