Skip to content

Instantly share code, notes, and snippets.

/-

Created November 2, 2014 10:53
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 anonymous/ff8b66af904fb8e53d7b to your computer and use it in GitHub Desktop.
Save anonymous/ff8b66af904fb8e53d7b to your computer and use it in GitHub Desktop.
'use strict';
/**
* Module dependencies.
*/
var mongoose = require('mongoose'),
Schema = mongoose.Schema;
/**
* Message Schema
*/
var MessageSchema = new Schema({
body: {
type: String,
default: '',
trim: true
},
location: {
lat: {
type: Number
},
long: {
type: Number
}
},
created: {
type: Date,
default: Date.now
},
user: {
type: Schema.ObjectId,
ref: 'User'
}
});
mongoose.model('Message', MessageSchema);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment