Created
April 23, 2018 11:21
-
-
Save thoughtspeed7/68f187042fee49aad1742d0a0b3e73bb to your computer and use it in GitHub Desktop.
Reusing Mongoose Schema
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// om namah shivay | |
const mongoose = require('mongoose'); | |
const common = require('./common'); | |
const user_schema = new mongoose.Schema({ | |
_id: mongoose.Schema.ObjectId, | |
first_name: String, | |
last_name: String, | |
mobile: common.mobile, | |
roaming_mobile: common.mobile | |
}, { | |
collection: 'User' | |
}); | |
const user_model = mongoose.model('User', user_schema); | |
module.exports = { | |
user_model | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment