Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var mongoose = require('mongoose'),
- Schema = mongoose.Schema;
- module.exports = function () {
- mongoose.connect('mongodb://localhost/test',
- function(err) {
- if (err) { throw err; }
- }
- );
- };
- var User = new Schema({
- username: {type: String, index: { unique: true }},
- mdp: String
- });
- module.exports = mongoose.model('User', User);
Advertisement
Add Comment
Please, Sign In to add comment