MongoDB.ClientCommandWithServerId
---------------------------------

This function executes a command on a specific server, using the database and command specification provided.

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

MBS( "MongoDB.ClientCommandWithServerId"; MongoDBRef; dbName; Query; ServerID ) 

**MBS**( **"MongoDB.ClientCommandWithServerId";** /\* This function executes a command on a specific server, using the database and command specification provided. \*/  
**$MongoDBRef**; /\* The reference number for the mongo connection.e.g. $MongoDB \*/   
**$dbName**; /\* The name of the database to run the command on. \*/   
**$Query**; /\* The query as JSON. \*/   
**$ServerID**) /\* An opaque id specifying which server to use.e.g. 123 \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| MongoDBRef | The reference number for the mongo connection. | $MongoDB |
| dbName | The name of the database to run the command on. |  |
| Query | The query as JSON. |  |
| ServerID | An opaque id specifying which server to use. | 123 |

### Result

Returns OK or error.

### Description

This function executes a command on a specific server, using the database and command specification provided.  
This function is not considered a retry-able read operation.  
### Release notes

- **Version 14.2**
    - Added [MongoDB.ClientCommand](https://www.mbsplugins.eu/MongoDBClientCommand.shtml), [MongoDB.ClientCommandQuery](https://www.mbsplugins.eu/MongoDBClientCommandQuery.shtml) and [MongoDB.ClientCommandWithServerId](https://www.mbsplugins.eu/MongoDBClientCommandWithServerId.shtml) functions.

### Blog Entries

- [News in MBS FileMaker Plugin 14.2](https://www.mbsplugins.de/archive/2024-05-21/News_in_MBS_FileMaker_Plugin_1/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 14.2pr1](https://www.mbsplugins.de/archive/2024-04-02/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 20th March 2024 , last changed 20th March 2024

  
[MongoDB.ClientCommandQuery](MongoDBClientCommandQuery.md) - [MongoDB.CloseChangeStream](MongoDBCloseChangeStream.md)

[HTML Version](MongoDBClientCommandWithServerId.shtml)