User.js 710 Bytes
const mongoose = require('mongoose');
const Schema = mongoose.Schema;

const UserSchema = new Schema({
    user: {
        type: String,
        require: true
    },
    todos: [
        {
            type: String,
            required: true
        }
    ]
})

module.exports = User = mongoose.model('users', UserSchema);

// const mongoose = require('mongoose');
// const Schema = mongoose.Schema;

// // create Schema
// const UserSchema = new Schema({
//     user: {
//         type: String,
//         required: true
//     },
//     todos: [
//         {
//             type: String,
//             require: true
//         }
//     ]
// })

// module.exports = User = mongoose.model('users', UserSchema)