Skip to content

Instantly share code, notes, and snippets.

@ramazankanbur
Created October 10, 2019 15:37
Show Gist options
  • Save ramazankanbur/553818238e170322167bd6f11e13d0b7 to your computer and use it in GitHub Desktop.
Save ramazankanbur/553818238e170322167bd6f11e13d0b7 to your computer and use it in GitHub Desktop.
sample
const mongoose = require('mongoose');
var Schema = mongoose.Schema;
const userSchema = new Schema({
name: {
type: String,
required: [true, 'isim alanı zorunlu alan']
},
password: {
type: String,
required: [true, 'şifre alanı zorunlu alan']
},
isAdmin: {
type: Boolean,
default: false
},
userImagePath:{
type:String
},
userImage:{
data:Buffer,
contentType:String
},
isDelete:{
type:Boolean,
default:false
}
});
const UserModel = mongoose.model('user', userSchema);
module.exports = UserModel;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment