Skip to content

Instantly share code, notes, and snippets.

@thanhtungdp
Created January 2, 2020 18:45
Show Gist options
  • Save thanhtungdp/cb0da8d472445095e921bebe904c2aaf to your computer and use it in GitHub Desktop.
Save thanhtungdp/cb0da8d472445095e921bebe904c2aaf to your computer and use it in GitHub Desktop.
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