Advertisement
Guest User

Untitled

a guest
Feb 20th, 2016
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. 'use strict';
  2.  
  3. var mongoose = require('mongoose');
  4. var Schema = mongoose.Schema;
  5.  
  6. // define the schema for our user model
  7. var User = new Schema({
  8. email: String,
  9. password: String
  10. });
  11.  
  12. User.methods.isEmailQualified = function(email) {
  13. var re = /\S+@\S+\.\S+/;
  14. return re.test(email);
  15. };
  16.  
  17. module.exports = mongoose.model('User', User);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement