I have a Node.js application using Express that stores data in mongoDB (locally).
Now he successfully clicked on the geroku on the cedar stack and the server is working. I added the mongohq terminal through the terminal.
Now ... how to connect this mongoDB via mongohq to my application to start using it ??? I do not see a tutorial for this anywhere on the Internet. If you can point me to one or start me with where to add the configuration, I would really appreciate it!
Thank you very much.
Update:
I tried the following (with real values ββfor MYPASSWORD and MYDBNUMBER:
in routes.js
var db = mongoose.connect('mongodb://heroku:<MYPASSWORD>@staff.mongohq.com:10049/<MYDBNUMBER>');
in my schema.js (also tried using the hero
var mongoose = require('mongoose'); mongoose.connect('mongodb://heroku:<MYPASSWORD>@staff.mongohq.com:10049/<MYDBNUMBER>');
my package.json
{ "name": "NAME" , "version": "0.0.1" , "dependencies": { "express": "2.4.6" , "connect": "1.7.1" , "stylus": ">= 0.0.1" , "mongodb": ">= 0.9.6-7" , "mongoose": ">= 2.0.0" , "ejs": ">=0.4.3" } }
Right now, only root '/' GET is successful. In fact, if I try / page / ANYTHING, I can successfully get the displayed page of 500 errors that I made to handle attempts to get "pages" that were not created ... This seems strange to me. Everything else gives me an internal server error.
ALSO, if I go to mongohq and open my database there, a collection was created for my models, and indexes for uniqueness were created, even if I could not access the pages to create or view the model in my application ...
happy to provide any other information ... so stuck.