Skip to content

Instantly share code, notes, and snippets.

@xjamundx
Created November 2, 2011 02:20
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xjamundx/1332681 to your computer and use it in GitHub Desktop.
Save xjamundx/1332681 to your computer and use it in GitHub Desktop.
Sample Mongoose Model File For Use With MongoHQ
var db = require('./config/db')
var mongoose = require('mongoose')
var Schema = mongoose.Schema
var Review = new Schema({
article : String
, count : Number
, date : { type: Date, default: Date.now }
, images : [String]
, industry : String
, location : {
city : String
, state : String
, zip : String
, address : String
}
, rating : String
, slug : String
, snippet : String
, tags : [String]
, title : String
, url : String
})
mongoose.connect('mongodb://' + db.user + ':' + db.pass + '@' + db.host + ':' + db.port + '/' + db.name)
mongoose.model('Review', Review)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment