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
- MongoDB.CloseDatabase
- MongoDB.FindDatabases
- MongoDB.OpenDatabase
- MongoDB.OpenDefaultDatabase
- MongoDB.WatchDatabase
Release notes
- Version 13.1
- Added MongoDB.GetOptions, MongoDB.GetTLS and MongoDB.SetDatabase functions.
Blog Entries
This function checks for a license.
Created 22nd January 2023, last changed 22nd January 2023
