mirror of
https://github.com/sstent/expressmongotest.git
synced 2026-01-25 08:34:53 +00:00
18 lines
337 B
JavaScript
18 lines
337 B
JavaScript
var mongoose = require('mongoose');
|
|
|
|
// simple but incomplete email regexp:
|
|
var emailRegexp = /.+\@.+\..+/;
|
|
|
|
var UserSchema = new mongoose.Schema({
|
|
username: {type: String, unique: true},
|
|
name: String,
|
|
password: String,
|
|
email: {
|
|
type: String,
|
|
required: true,
|
|
match: emailRegexp
|
|
|
|
}
|
|
});
|
|
|
|
module.exports = UserSchema; |