Skip to content

Instantly share code, notes, and snippets.

@ahmadawais
Created May 21, 2018 21:03
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 ahmadawais/c4c33b2a0e519ef79efa50e9aeb7f40f to your computer and use it in GitHub Desktop.
Save ahmadawais/c4c33b2a0e519ef79efa50e9aeb7f40f to your computer and use it in GitHub Desktop.
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