Created
October 4, 2019 21:25
-
-
Save stmoerman/d0f47bf8de8416b97db14c2340fc3bc2 to your computer and use it in GitHub Desktop.
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
var customer = new Customer({ | |
firstName: 'John', | |
lastName: 'Doe', | |
company: 'wick inc', | |
connectInfo: { | |
tel: [1234,5678], | |
email: ['john@wick.com', 'wick@inc.com'], | |
address: { | |
city: 'Gotham', | |
street: 'Bank Doc', | |
houseNumber: '1' | |
} | |
} | |
}) |
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
const mongoose = require('mongoose'); | |
const Schema = mongoose.Schema; | |
const CustomerSchema = new Schema({ | |
firstName: String, | |
lastName: String, | |
companyName: String, | |
connectInfo: { | |
tel: [Number], | |
email: [String], | |
address: { | |
city: String, | |
street: String, | |
houseNumber: String | |
} | |
} | |
}, { timestamps: true }); | |
module.exports = mongoose.model('Device', CustomerSchema); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment