Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const mongoose = require('mongoose');
- const UserSchema = new mongoose.Schema({
- userid: {
- type: String,
- required: true,
- },
- password: {
- type: String,
- requird: true,
- },
- first: {
- type: Date,
- default: Date.now,
- },
- last: {
- type: Date,
- default: Date.now,
- },
- visits: Number,
- });
- mongoose.model('User', UserSchema);
- mongoose.connect('mongodb://localhost/sample_db');
- const User = mongoose.model('User');
- const user = new User();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement