I would like to be able to query my mongoDB and display this result on my web page made with Node...right now I am using the mongojs driver - I've found the driver very very good for putting data into the DB - the syntax is the same as the Mongo shell and I can put the code right in my Node app. This task...simply showing the results of the query on the webpage, or even on the console, has proven very difficult. Here are the relevant parts of my code and what I tried.
var databaseUrl = "test"; // "username:[email protected]/mydb"
var collections = ["graph1"]
var db = require("mongojs").connect(databaseUrl, collections);
console.log(db.graph1.find());
I have made a collection called graph1 and in the mongo prompt this yields results. Note...I do want to display it in HTML...but I spose if I can get it to print to console I can get it in my HTML.
It currently outputs this:
{_oncursor: { get: [Function], put: [Function] } }
Some kind of prototype for what I actually want, which is this:
{ "x" : "0", "y" : "1343725568", "_id" : ObjectId("4fba6....") }