pomodoro/server/services/pomodoros/model.js

40 lines
622 B
JavaScript

'use strict';
const mongoose = require('mongoose');
const PomodoroSchema = new mongoose.Schema({
startTime: {
type: Date,
required: true,
},
endTime: {
type: Date,
required: true,
},
type: {
type: String,
required: true,
},
length: {
type: Number,
required: true,
},
name: String,
location: String,
user: {
type: mongoose.Schema.Types.ObjectId,
ref: 'User',
required: true,
},
ip: {
type: String,
required: true,
},
userAgent: {
type: String,
required: true,
},
});
module.exports = mongoose.model('Pomodoro', PomodoroSchema);