How would you implement an asynch mongodb using vistax64/cygwin/node.js from scratch which resembles the original shell?
When I try tutorials, I get things all very similar too:
admin@RainComputer ~/nodeProjects
$ node dbtest.js
mongo://localhost:27017: Error: EPERM, Operation not permitted
Finished scanning... primary? no
undefined
mongo://localhost:27017: Disconnected
I just need any advice to install from scratch (just node and npm) a mongodb driver, preferably without using network functions, and close to the original shell.
I got this working by doing the following:
(node package manager) and install
ExpressJS, Jade and whatever else
you’d like.
and install mongoDB. Start it running
with “mongod” and note the port it
listens on. Then test from the
console using “mongo”. All should
work within windows before trying
from Cygwin.
mongo driver using “npm install
mongodb”
from your javascript
code, connect to the DB:
If you get no errors, check in the mongo console with “show dbs” you should see a new DB named “my-db-name” in there. One more thing: run cygwin “as administrator” in windows, I’m not sure if it matters but just in case.
Hope that helps,
-fs