Topics   All   MacOS (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server   Client   Old   Deprecated   Guides   Examples   Videos
New in version: 12.0   12.1   12.2   12.3   12.4   12.5   13.0   13.1   13.2   13.3    Statistic    FMM    Blog  

MongoDB.TextToBinary

Converts a text to JSON for MongoDB.

Component Version macOS Windows Linux Server iOS SDK
MongoDB 13.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "MongoDB.TextToBinary"; Text { ; Encoding } )   More

Parameters

Parameter Description Example Flags
Text The text to save. "Hello World"
Encoding The text encoding for text parameter.
Default is UTF-8.
"UTF-8" Optional

Result

Returns JSON or error.

Description

Converts a text to JSON for MongoDB.
Reads the text in encoding, converts to base64 and embeds it in a $binary JSON for use in MongoDB.

Examples

Convert text to binary:

MBS( "MongoDB.TextToBinary"; "Hello World")

Example result:
{ "$binary" : { "base64" : "SGVsbG8gV29ybGQ=", "subType" : "00" }

Release notes

Blog Entries

This function does not need a paid license.

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


MongoDB.StartTransaction - MongoDB.Time

💬 Ask a question or report a problem


Start Chat