Advertisement
Guest User

Untitled

a guest
Feb 10th, 2016
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const mongoose = require('mongoose');
  2. const Schema = mongoose.Schema;
  3.  
  4. const ReceiptSchema = new Schema({
  5.   name: String,
  6. });
  7.  
  8. const UserSchema = new Schema({
  9.   username: { type: String, required: true, index: { unique: true } },
  10.   password: { type: String, required: true },
  11.   receipts: [ReceiptSchema],
  12. });
  13.  
  14. module.exports = mongoose.model('User', UserSchema);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement