Created
April 23, 2018 11:22
-
-
Save thoughtspeed7/9fc8cf0913591891c86af80d9384120b to your computer and use it in GitHub Desktop.
Reusing Mongoose Schema
This file contains hidden or 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 user = require('./user'); | |
| const test = () => { | |
| const user_model = new user.user_model(); | |
| user_model._id = new mongoose.Types.ObjectId(); | |
| user_model.first_name = 'Raj'; | |
| user_model.last_name = 'Chaudhary'; | |
| user_model.mobile.country_code = '91'; | |
| user_model.mobile.number = '0000000000'; | |
| user_model.roaming_mobile.country_code = '44'; | |
| user_model.roaming_mobile.number = '1111111111'; | |
| console.log(`${JSON.stringify(user_model, undefined, 4)}`); | |
| }; | |
| test(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment