Created
November 2, 2011 02:20
-
-
Save xjamundx/1332681 to your computer and use it in GitHub Desktop.
Sample Mongoose Model File For Use With MongoHQ
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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