var mongoose = require('mongoose'),
	Schema = mongoose.Schema,
	passportLocalMongoose = require('passport-local-mongoose');
Library = require('./Library');

var userSchema = new Schema({
	preferredName: String,
	libraries: [{
		type: Schema.Types.ObjectId,
		ref: 'Library'
	}]

});

userSchema.plugin(passportLocalMongoose);

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