MongoDB.SetAppName
------------------

Sets the client application name.

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

MBS( "MongoDB.SetAppName"; MongoDBRef; Name ) 

**MBS**( **"MongoDB.SetAppName";** /\* Sets the client application name. \*/  
**$MongoDBRef**; /\* The reference number for the mongo connection.e.g. $MongoDB \*/   
**$Name**) /\* The new name. \*/ 

### Parameters

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

### Result

Returns OK or error.

### Description

Sets the client application name.  
This value is used by MongoDB when it logs connection information and profile information, such as slow queries.  
  
Default: Empty (no appname)  
### Examples

Set the application name:

 Set Variable \[ $r ; Value: MBS ( "MongoDB.SetAppName"; $MongoDB ; "MyApp" ) \]  
### See also

- [MongoDB.GetAppName](MongoDBGetAppName.md)
- [MongoDB.GetUserName](MongoDBGetUserName.md)
- [MongoDB.SetURI](MongoDBSetURI.md)
- [MongoDB.SetUserName](MongoDBSetUserName.md)

### Release notes

- **Version 14.2**
    - Added [MongoDB.GetAppName](https://www.mbsplugins.eu/MongoDBGetAppName.shtml), [MongoDB.SetAppName](https://www.mbsplugins.eu/MongoDBSetAppName.shtml) and [MongoDB.GetCredentials](https://www.mbsplugins.eu/MongoDBGetCredentials.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 is free to use.

Created 20th March 2024 , last changed 11st May 2024

  
[MongoDB.ServerDescriptions](MongoDBServerDescriptions.md) - [MongoDB.SetAuthMechanism](MongoDBSetAuthMechanism.md)

[HTML Version](MongoDBSetAppName.shtml)