node.js - NodeJS - MongoClient.Connect with URL to DB Other Than Default -


i'd use mongoclient.connect(url) option connecting node , in fact work authenticated connections admin database. however, if try specify different database "auth fails" code 18.

i think means credentials setup on admin database and, unfortunately, can't change arrangement (for now, anyway).

it seems url syntax direction driver heading, i'd use if possible. there way use syntax, authenticate , connect admin database, , connection 1 of other databases on server?

i found out how this: use instance ("admin") open database have access to:

db2 = db.db("name of other name"); 

see hidden inside the documentation


Comments

Popular posts from this blog

c++ - How to add Crypto++ library to Qt project -

jQuery Mobile app not scrolling in Firefox -

How to use vim as editor in Matlab GUI -