mongoose Mongoose Schemas Basic Schema


Example

A basic User Schema:

var mongoose = require('mongoose');

var userSchema = new mongoose.Schema({
    name: String,
    password: String,
    age: Number,
    created: {type: Date, default: Date.now}
});

var User = mongoose.model('User', userSchema);

Schema Types.