12345678910111213141516171819202122232425262728
  1. /* Model for an Admin in the DB */
  2. var mongoose = require('mongoose');
  3. var Schema = mongoose.Schema;
  4. var AdminSchema = new Schema(
  5. {
  6. _id: String,
  7. username: {
  8. type: String,
  9. required: true
  10. },
  11. password: {
  12. type: String,
  13. required: true
  14. },
  15. name: String,
  16. description: String
  17. },
  18. {
  19. collection: 'admins'
  20. }
  21. );
  22. module.exports = mongoose.model('Admin', AdminSchema);