Topics   All   MacOS (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server   Client   Old   Deprecated   Guides   Examples   Videos
New in version: 12.2   12.3   12.4   12.5   13.0   13.1   13.2   13.3   13.4   13.5    Statistic    FMM    Blog  

MongoDB.SetDatabase

Sets the URI's database, after the URI has been parsed.

Component Version macOS Windows Linux Server iOS SDK
MongoDB 13.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "MongoDB.SetDatabase"; MongoDBRef; DatabaseName )   More

Parameters

Parameter Description Example
MongoDBRef The reference number for the mongo connection. $MongoDB
DatabaseName The new database name. "test"

Result

Returns OK or error.

Description

Sets the URI's database, after the URI has been parsed.
The driver authenticates to this database if the connection string includes authentication credentials. This database is used when you use MongoDB.OpenDefaultDatabase function.

See also

Release notes

Blog Entries

This function checks for a license.

Created 22nd January 2023, last changed 22nd January 2023


MongoDB.SetCompressors - MongoDB.SetPassword

💬 Ask a question or report a problem