Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

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