venmjs
Version:
This is a tool 🔧 that can be installed in your terminal at any time ⛏️ it was made for beginners and even for experts, for his utilities, and for a simple creation process 🧨. Every web developer knows how frustrating is to deal with the creation of a ne
18 lines (15 loc) • 337 B
JavaScript
const { Schema, model } = require('mongoose');
const userSchema = new Schema(
{
name: {
type: String,
required: [true, 'name field is required'],
},
age: {
type: Number,
required: [true, 'age field is required'],
},
},
{ timestamps: true },
);
module.exports = model('users', userSchema);