Skip to content

Instantly share code, notes, and snippets.

@sudowork
Forked from jdsiddon/gist:7441841
Last active December 28, 2015 04:19
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 sudowork/7441905 to your computer and use it in GitHub Desktop.
Save sudowork/7441905 to your computer and use it in GitHub Desktop.
/* sites.js */
var
mongoose = require('mongoose')
, Schema = mongoose.Schema
, update = require('./updates')
;
//Define the site model
var siteSchema = new Schema({
client: String,
siteUrl: String,
siteMaintenanceRequirements: String,
siteLastMaintenance: [update.schema],
siteContractActive: Boolean
});
module.exports = mongoose.model('site', siteSchema);
/* updates.js */
var
mongoose = require('mongoose')
, Schema = mongoose.Schema
, ObjectId = Schema.ObjectId
;
//Define the site model
var updateSchema = new Schema({
maintenanceDescription: String,
person: String,
date: Date
});
module.exports = mongoose.model('update', updateSchema);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment