banyucenter

Untitled

Nov 23rd, 2018
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var mongoose = require('mongoose');
  2. var Schema = mongoose.Schema;
  3. var WargaSchema = new Schema(
  4.   {
  5.     nama: { type: String, required: true },
  6.     umur: { type: String, required: true },
  7.     pekerjaan: { type: String, required: true },
  8.     desa_id: { type: Schema.Types.ObjectId, ref: 'Desa', required: true }
  9.   }
  10. );
  11.  
  12. //Export model
  13. module.exports = mongoose.model('Warga', WargaSchema);
Add Comment
Please, Sign In to add comment