MongoDB.CloseDatabase
---------------------

Closes the current database explicitly.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [MongoDB](component_MongoDB.md) | [12.4](newinversion124.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "MongoDB.CloseDatabase"; MongoDBRef ) 

**MBS**( **"MongoDB.CloseDatabase";** /\* Closes the current database explicitly. \*/  
**$MongoDBRef**) /\* The reference number for the mongo connection.e.g. $MongoDB \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| MongoDBRef | The reference number for the mongo connection. | $MongoDB |

### Result

Returns OK or error.

### Description

Closes the current database explicitly.  
You usually don't need to call this as this happens automatically when you open a new database or close the connection.  
### See also

- [MongoDB.FindDatabases](MongoDBFindDatabases.md)
- [MongoDB.OpenDatabase](MongoDBOpenDatabase.md)
- [MongoDB.SetDatabase](MongoDBSetDatabase.md)
- [MongoDB.WatchDatabase](MongoDBWatchDatabase.md)

### Release notes

- **Version 12.4**
    - Added [MongoDB.CloseCollection](https://www.mbsplugins.eu/MongoDBCloseCollection.shtml) and [MongoDB.CloseDatabase](https://www.mbsplugins.eu/MongoDBCloseDatabase.shtml) functions.

### Blog Entries

- [MBS FileMaker Plugin 12.4](https://www.mbsplugins.de/archive/2022-09-27/MBS_FileMaker_Plugin_124/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 12.4pr1](https://www.mbsplugins.de/archive/2022-08-01/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 27th July 2022 , last changed 27th July 2022

  
[MongoDB.CloseCursor](MongoDBCloseCursor.md) - [MongoDB.CollectionName](MongoDBCollectionName.md)

[HTML Version](MongoDBCloseDatabase.shtml)