var mongoose = require('mongoose');

var userSchema = new mongoose.Schema({
    userid: String,
    username: String,
    password: String,
    emailid: String,
    streamname: String,
    rolename: String,
    createdby: String,
    createdon: Date,
    updatedby: String,
    updatedon: Date,
    activeflag: Boolean
});

userSchema.methods.validPassword = function (pwd) {
    return (this.password === pwd);
};

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

module.exports = usermaster;