Skip to content

Instantly share code, notes, and snippets.

@stmoerman
Created October 4, 2019 21:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stmoerman/d0f47bf8de8416b97db14c2340fc3bc2 to your computer and use it in GitHub Desktop.
Save stmoerman/d0f47bf8de8416b97db14c2340fc3bc2 to your computer and use it in GitHub Desktop.
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'
}
}
})
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