MongoDB.ContainerToBinary
-------------------------

Converts a container to JSON for MongoDB.

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

MBS( "MongoDB.ContainerToBinary"; Container ) 

**MBS**( **"MongoDB.ContainerToBinary";** /\* Converts a container to JSON for MongoDB. \*/  
**$Container**) /\* The container value to use. \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| Container | The container value to use. |  |

### Result

Returns JSON or error.

### Description

Converts a container to JSON for MongoDB.  
Reads the container, converts to base64 and embeds it in a $binary JSON for use in MongoDB.  
### Examples

Try it:

 MBS ("MongoDB.ContainerToBinary"; MyTable::Photo )  
### Release notes

- **Version 16.3**
    - Fixed memory leak in MongoDB.NowUTC, MongoDB.Time, MongoDB.ContainerToBinary and MongoDB.TextToBinary functions.
- **Version 13.2**
    - Added [MongoDB.ContainerToBinary](https://www.mbsplugins.eu/MongoDBContainerToBinary.shtml) and [MongoDB.TextToBinary](https://www.mbsplugins.eu/MongoDBTextToBinary.shtml) functions.

### Blog Entries

- [MBS FileMaker Plugin, version 16.3pr1](https://www.mbsplugins.de/archive/2026-06-01/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [New in MBS FileMaker Plugin 13.2](https://www.mbsplugins.de/archive/2023-05-17/New_in_MBS_FileMaker_Plugin_13/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 13.2pr1](https://www.mbsplugins.de/archive/2023-04-01/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)

This function is free to use.

Created 15th March 2023 , last changed 15th March 2023

  
[MongoDB.Connect](MongoDBConnect.md) - [MongoDB.CreateCollection](MongoDBCreateCollection.md)

[HTML Version](MongoDBContainerToBinary.shtml)