Instantly share code, notes, and snippets.

Embed
What would you like to do?
Azure Function: Schema for MongoDB modeSchema.js
/**
* Model: Sale
*/
const mongoose = require('mongoose');
mongoose.Promise = global.Promise;
// Sale Schema.
const saleSchema = new mongoose.Schema({
sale_gross: Number,
earnings: Number,
currency: String,
memberSince: Date,
customerEmail: String,
event_time: {
type: Date,
default: Date.now
},
});
// Export the model.
module.exports = mongoose.model('Sale', saleSchema);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment