Advertisement
Guest User

User Model

a guest
Mar 22nd, 2019
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const mongoose = require("mongoose");
  2.  
  3. const userSchema = mongoose.Schema({
  4.   userID: {
  5.     type: String,
  6.     required: true,
  7.     unique: true,
  8.     match: /^[0-9]{17,19}$/
  9.   },
  10.   tag: {
  11.     type: String,
  12.     required: true,
  13.     match: /^(?!(everyone|here|discordtag|.*(`{1,3}).*\2))[^@#:]{2,32}#\d{4}$/
  14.   },
  15. }, {collection: "Users"});
  16.  
  17. module.exports = mongoose.model("users", userSchema);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement