On this page
connect()
On this page
Description
- connect( url, user, password )
- 
     Creates a connection to a MongoDB instance and returns the reference to the database. However, in most cases, use the Mongo()object and itsgetDB()method instead.Parameter Type Description urlstring Specifies the connection string. You can specify either: - <hostname>:<port>/<database>
- <hostname>/<database>
- <database>
 userstring Optional. Specifies an existing username with access privileges for this database. If useris specified, you must include thepasswordparameter as well.passwordstring Optional unless the userparameter is specified. Specifies the password for theuser.