pesto-students/batch-11-relayer

View on GitHub
server/models/Users.js

Summary

Maintainability
A
0 mins
Test Coverage
import mongoose from 'mongoose';
import shortid from 'shortid';

const { Schema } = mongoose;

const User = new Schema(
  {
    userId: { type: String, default: shortid.generate },
    email: { type: String, required: true, unique: true },
    password: { type: String },
  },
  { timestamps: true },
);

export default mongoose.model('User', User);