Here is my node.js file I am running on Heroku. It works fine locally, but when I click it on Heroku, the database collection is not created and there are no errors. Ultimately, I'm just trying to get him to actually create a connection while it works on Heroku. Thanks.
var mongoose = require('mongoose'), db_url = process.env.MONGOHQ_URL || "mongodb://john:<mypasswordwashere>@staff.mongohq.com:10053/app3305538", db = mongoose.connect(db_url), Schema = mongoose.Schema; //Mongoose DB Test var MsgSchema = new Schema({ date: {type: Date, default: Date.now}, message: String }); var MsgModel = db.model("messages", MsgSchema); var Msg = new MsgModel(); Msg.message = "blurgh"; Msg.save();
source share