Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Set Up Model In MongoDB

var mongoose = require('mongoose')
var Schema = mongoose.Schema

var userSchema = Schema({
   username: String,
   first_name: String,
   last_name: String,
   email: String,
	password: String,
  avatar: String,
	online: Boolean,

});

module.exports = mongoose.model('User', userSchema);
 
PREVIOUS NEXT
Tagged: #Set #Up #Model #In #MongoDB
ADD COMMENT
Topic
Name
7+7 =