Created
January 6, 2011 07:33
-
-
Save 3rd-Eden/767653 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 mongo = require("mongodb"); | |
var connection = new mongo.Db( "database-namehere", new mongo.Server( "the host of your db", "the port number" ) ); | |
// open the connection | |
connection.open(function(err){ | |
if( err ) console.error( err ); | |
connection.authenticate( "user", "password", function( err ){ | |
if( err ) console.error( err ); | |
alert("working, authenticated connection") | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment