-
Lucendio authored
* introduce a test on the server to see if user creation works (backend process <-> db only; still needs a test that involves the router, too) * main server process is no connection-aware and wont start if database is not reachable * some renaming, cause it's more descriptive * unify quote usage
Lucendio authored* introduce a test on the server to see if user creation works (backend process <-> db only; still needs a test that involves the router, too) * main server process is no connection-aware and wont start if database is not reachable * some renaming, cause it's more descriptive * unify quote usage
Todos.js 555 B
const mongoose = require('mongoose');
const schema = new mongoose.Schema({
title: {
type: String,
required: true,
maxlength: 100,
},
description: {
type: String
},
important: {
type: Boolean,
default: false
},
done: {
type: Boolean,
default: false
},
user: {
type: mongoose.Schema.Types.ObjectId,
required: true,
}
}, {
timestamps: true
});
const model = mongoose.model( 'ToDos', schema );
module.exports = { schema, model };