Skip to content

Instantly share code, notes, and snippets.

@kwhinnery
Last active January 21, 2016 22:59
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 kwhinnery/423711415464d4834bca to your computer and use it in GitHub Desktop.
Save kwhinnery/423711415464d4834bca to your computer and use it in GitHub Desktop.
var mongoose = require('mongoose');
var propertySchema = new mongoose.Schema({
description: { type: String, required: true },
imageUrl: { type: String, required: true },
date: { type: Date, default: Date.now },
owner: {
type: mongoose.Schema.Types.ObjectId,
ref: 'user'
}
});
var Property = mongoose.model('property', propertySchema);
module.exports = Property;
var mongoose = require('mongoose');
var propertySchema = new mongoose.Schema({
description: { type: String, required: true },
imageUrl: { type: String, required: true },
date: { type: Date, default: Date.now },
owner: {
type: mongoose.Schema.Types.ObjectId,
ref: 'user'
}
});
var property = mongoose.model('property', propertySchema);
module.exports = property;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment