Component: MongoDB 
-------------------

Connect to a Mongo database.

MongoDB is a source-available cross-platform document-oriented database program. Classified as a NoSQL database program, MongoDB uses JSON-like documents with optional schemas.

| Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|
| [12.3](newinversion123.md "First functions introduced with version 12.3.") / [16.3](newinversion163.md "Newest functions in version 16.3.") | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

  
| Item | Details |
|:--|:--|
| [MongoDB.AbortTransaction](MongoDBAbortTransaction.md)   Abort a multi-document transaction. | All   12.5 |
| [MongoDB.AggregateCollection](MongoDBAggregateCollection.md)   Creates an aggregate collection. | All   13.1 |
| [MongoDB.AggregateDatabase](MongoDBAggregateDatabase.md)   Creates an aggregate database. | All   13.1 |
| [MongoDB.BSONtoJSON](MongoDBBSONtoJSON.md)   Converts BSON to JSON. | All   12.3 |
| [MongoDB.ChangeStreamErrorDocument](MongoDBChangeStreamErrorDocument.md)   Checks if an error has occurred when creating or iterating over a change stream. | All   13.0 |
| [MongoDB.ChangeStreamResumeToken](MongoDBChangeStreamResumeToken.md)   Queries resume token. | All   13.0 |
| [MongoDB.ClientCommand](MongoDBClientCommand.md)   Execute a command on the server, interpreting options according to the MongoDB server version. | All   14.2 |
| [MongoDB.ClientCommandQuery](MongoDBClientCommandQuery.md)  **Deprecated**    Creates a query cursor. | All   14.2 |
| [MongoDB.ClientCommandWithServerId](MongoDBClientCommandWithServerId.md)   This function executes a command on a specific server, using the database and command specification provided. | All   14.2 |
| [MongoDB.CloseChangeStream](MongoDBCloseChangeStream.md)   Closes change stream. | All   13.0 |
| [MongoDB.CloseCollection](MongoDBCloseCollection.md)   Closes the current collection explicitly. | All   12.4 |
| [MongoDB.CloseCursor](MongoDBCloseCursor.md)   Closes cursor. | All   12.3 |
| [MongoDB.CloseDatabase](MongoDBCloseDatabase.md)   Closes the current database explicitly. | All   12.4 |
| [MongoDB.CollectionName](MongoDBCollectionName.md)   Queries name of current collection. | All   12.3 |
| [MongoDB.CollectionNames](MongoDBCollectionNames.md)   Fetches the list of the names of all of the collections in database. | All   12.3 |
| [MongoDB.Command](MongoDBCommand.md)   Execute a command on the server. | All   13.1 |
| [MongoDB.CommitTransaction](MongoDBCommitTransaction.md)   Commit a multi-document transaction. | All   12.5 |
| [MongoDB.Connect](MongoDBConnect.md)   Connects the client using the URI provided. | All   12.3 |
| [MongoDB.ContainerToBinary](MongoDBContainerToBinary.md)   Converts a container to JSON for MongoDB. | All   13.2 |
| [MongoDB.CreateCollection](MongoDBCreateCollection.md)   Creates a collection in the database. | All   12.3 |
| [MongoDB.CursorBatchSize](MongoDBCursorBatchSize.md)   Queries batch size. | All   12.3 |
| [MongoDB.CursorCurrent](MongoDBCursorCurrent.md)   Queries current record as JSON. | All   12.3 |
| [MongoDB.CursorErrorDocument](MongoDBCursorErrorDocument.md)   Checks to see if an error has occurred while iterating the cursor. | All   12.4 |
| [MongoDB.CursorGetMaxAwaitTimeMS](MongoDBCursorGetMaxAwaitTimeMS.md)   The maximum amount of time for the server to wait on new documents to satisfy a tailable cursor query. | All   12.3 |
| [MongoDB.CursorID](MongoDBCursorID.md)   Retrieves the cursor id used by the server to track the cursor. | All   12.3 |
| [MongoDB.CursorLimit](MongoDBCursorLimit.md)   Queries current limit. | All   12.3 |
| [MongoDB.CursorMore](MongoDBCursorMore.md)   Whether there may be more data. | All   12.3 |
| [MongoDB.CursorNext](MongoDBCursorNext.md)   Queries the next record as JSON. | All   12.3 |
| [MongoDB.CursorRecords](MongoDBCursorRecords.md)   Queries the all records as JSON. | All   14.4 |
| [MongoDB.CursorSetBatchSize](MongoDBCursorSetBatchSize.md)   Sets batch size, | All   12.3 |
| [MongoDB.CursorSetLimit](MongoDBCursorSetLimit.md)   Limits the number of documents in the result set. | All   12.3 |
| [MongoDB.CursorSetMaxAwaitTimeMS](MongoDBCursorSetMaxAwaitTimeMS.md)   Sets the maximum amount of time for the server to wait on new documents to satisfy a tailable cursor query. | All   12.3 |
| [MongoDB.DatabaseCommand](MongoDBDatabaseCommand.md)   Creates a collection in the database. | All   12.3 |
| [MongoDB.DatabasesNames](MongoDBDatabasesNames.md)   Queries the MongoDB server for a list of known databases. | All   12.3 |
| [MongoDB.DeleteMany](MongoDBDeleteMany.md)   Deletes many records. | All   12.3 |
| [MongoDB.DeleteOne](MongoDBDeleteOne.md)   Deletes one record. | All   12.3 |
| [MongoDB.EstimatedDocumentCount](MongoDBEstimatedDocumentCount.md)   Executes a count query on collection. | All   12.3 |
| [MongoDB.Find](MongoDBFind.md)   Query on collection, passing arbitrary query options to the server in options. | All   12.3 |
| [MongoDB.FindCollections](MongoDBFindCollections.md)   Fetches a cursor containing documents, each corresponding to a collection on this database. | All   12.3 |
| [MongoDB.FindDatabases](MongoDBFindDatabases.md)   Fetches list of database records. | All   12.3 |
| [MongoDB.FindIndexes](MongoDBFindIndexes.md)   Fetches a cursor containing documents, each corresponding to an index on this collection. | All   12.4 |
| [MongoDB.GetAppName](MongoDBGetAppName.md)   Queries the client application name. | All   14.2 |
| [MongoDB.GetAuthMechanism](MongoDBGetAuthMechanism.md)   Queries authentication mechanism. | All   12.3 |
| [MongoDB.GetAuthSource](MongoDBGetAuthSource.md)   Queries authorization source. | All   12.3 |
| [MongoDB.GetCompressors](MongoDBGetCompressors.md)   Queries compressors. | All   12.3 |
| [MongoDB.GetCredentials](MongoDBGetCredentials.md)   Queries credentials as JSON. | All   14.2 |
| [MongoDB.GetOptions](MongoDBGetOptions.md)   Queries the options from the URL. | All   13.1 |
| [MongoDB.GetPassword](MongoDBGetPassword.md)   Queries password used for login. | All   12.3 |
| [MongoDB.GetServiceHostName](MongoDBGetServiceHostName.md)   Queries service hostname for login. | All   12.3 |
| [MongoDB.GetServiceName](MongoDBGetServiceName.md)   Queries service name for login. | All   12.3 |
| [MongoDB.GetTLS](MongoDBGetTLS.md)   Whether this connection is set to be encrypted. | All   13.1 |
| [MongoDB.GetURI](MongoDBGetURI.md)   Fetches the URI as a string. | All   12.3 |
| [MongoDB.GetUserName](MongoDBGetUserName.md)   Queries username for login. | All   12.3 |
| [MongoDB.GridFS.Close](MongoDBGridFSClose.md)  **New in 16.3**    Closes the GridFS. | All   16.3 |
| [MongoDB.GridFS.Drop](MongoDBGridFSDrop.md)  **New in 16.3**    Requests that an entire GridFS be dropped, including all files associated with it. | All   16.3 |
| [MongoDB.GridFS.Find](MongoDBGridFSFind.md)  **New in 16.3**    Finds all gridfs files matching filter. | All   16.3 |
| [MongoDB.GridFS.FindOne](MongoDBGridFSFindOne.md)  **New in 16.3**    Find the first GridFS file matching filter. | All   16.3 |
| [MongoDB.GridFS.FindOneByFileName](MongoDBGridFSFindOneByFileName.md)  **New in 16.3**    Finds the first file matching the filename specified. | All   16.3 |
| [MongoDB.GridFS.GetChunks](MongoDBGridFSGetChunks.md)  **New in 16.3**    Gets collection that contains the chunks for files. | All   16.3 |
| [MongoDB.GridFS.GetFiles](MongoDBGridFSGetFiles.md)  **New in 16.3**    Gets collection that contains the file metadata for GridFS. | All   16.3 |
| [MongoDB.GridFS.Open](MongoDBGridFSOpen.md)  **New in 16.3**    Opens the GridFS. | All   16.3 |
| [MongoDB.GridFS.Read](MongoDBGridFSRead.md)  **New in 16.3**    Reads a file and returns container value. | All   16.3 |
| [MongoDB.GridFS.Remove](MongoDBGridFSRemove.md)  **New in 16.3**    Removes file and its data chunks from the MongoDB server. | All   16.3 |
| [MongoDB.GridFS.RemoveByFileName](MongoDBGridFSRemoveByFileName.md)  **New in 16.3**    Removes all files matching filename and their data chunks from the MongoDB server. | All   16.3 |
| [MongoDB.GridFS.Write](MongoDBGridFSWrite.md)  **New in 16.3**    Writes a container value as file to GridFS. | All   16.3 |
| [MongoDB.HasCollection](MongoDBHasCollection.md)   Checks to see if a collection exists on the MongoDB server within database. | All   12.3 |
| [MongoDB.InTransaction](MongoDBInTransaction.md)   Check whether a multi-document transaction is in progress for this session. | All   12.5 |
| [MongoDB.InsertMany](MongoDBInsertMany.md)   Insert documents into collection. | All   12.4 |
| [MongoDB.InsertOne](MongoDBInsertOne.md)   Inserts a document into collection. | All   12.3 |
| [MongoDB.IsTracing](MongoDBIsTracing.md)   Queries whether trace is enabled. | All   13.4 |
| [MongoDB.JSONtoBSON](MongoDBJSONtoBSON.md)   Converts JSON to BSON. | All   12.3 |
| [MongoDB.Keys](MongoDBKeys.md)   Queries current collection to find all the key names. | All   12.3 |
| [MongoDB.LibraryVersion](MongoDBLibraryVersion.md)   Queries library version. | All   12.3 |
| [MongoDB.List](MongoDBList.md)   Lists all IDs of current MongoDB objects. | All   12.5 |
| [MongoDB.MaxBSONSize](MongoDBMaxBSONSize.md)  **Deprecated**    Returns the maximum bson document size allowed by the cluster. | All   12.3 |
| [MongoDB.MaxMessageSize](MongoDBMaxMessageSize.md)  **Deprecated**    Returns the maximum message size allowed by the cluster. | All   12.3 |
| [MongoDB.New](MongoDBNew.md)   Creates a new MongoDB object. | All   12.3 |
| [MongoDB.NewCursorFromCommandReply](MongoDBNewCursorFromCommandReply.md)   Creates a cursor object from the reply of a command. | All   12.4 |
| [MongoDB.NextChange](MongoDBNextChange.md)   Iterates the underlying change stream, returning the next document. | All   13.0 |
| [MongoDB.NowUTC](MongoDBNowUTC.md)   Create a new JSON value with current date and time. | All   13.2 |
| [MongoDB.OpenCollection](MongoDBOpenCollection.md)   Sets the current collection. | All   12.3 |
| [MongoDB.OpenDatabase](MongoDBOpenDatabase.md)   Opens the given database. | All   12.3 |
| [MongoDB.OpenDefaultDatabase](MongoDBOpenDefaultDatabase.md)   Selects default database. | All   12.3 |
| [MongoDB.Ping](MongoDBPing.md)   Sends ping command. | All   13.4 |
| [MongoDB.Release](MongoDBRelease.md)   Frees the MongoDB object. | All   12.3 |
| [MongoDB.ReleaseAll](MongoDBReleaseAll.md)   Frees all MongoDB objects. | All   12.3 |
| [MongoDB.Rename](MongoDBRename.md)   This function is a helper to rename an existing collection on a MongoDB server. | All   12.4 |
| [MongoDB.ReplaceOne](MongoDBReplaceOne.md)   This replace one document in the collection that match selector with replacement. | All   12.3 |
| [MongoDB.SSLLibrary](MongoDBSSLLibrary.md)   Queries SSL library used. | All   13.4 |
| [MongoDB.ServerDescription](MongoDBServerDescription.md)   Get information about the server specified by ServerID. | All   12.3 |
| [MongoDB.ServerDescriptions](MongoDBServerDescriptions.md)   Fetches an server descroptions for all known servers in the topology. | All   12.3 |
| [MongoDB.SetAppName](MongoDBSetAppName.md)   Sets the client application name. | All   14.2 |
| [MongoDB.SetAuthMechanism](MongoDBSetAuthMechanism.md)   Sets authentication mechanism. | All   12.3 |
| [MongoDB.SetAuthSource](MongoDBSetAuthSource.md)   Sets authentication source. | All   12.3 |
| [MongoDB.SetCompressors](MongoDBSetCompressors.md)   Sets compressors to use. | All   12.3 |
| [MongoDB.SetDatabase](MongoDBSetDatabase.md)   Sets the URI's database, after the URI has been parsed. | All   13.1 |
| [MongoDB.SetPassword](MongoDBSetPassword.md)   Sets user password for login. | All   12.3 |
| [MongoDB.SetSSLOptions](MongoDBSetSSLOptions.md)   Sets the TLS (SSL) options to use when connecting to TLS enabled MongoDB servers. | All   13.4 |
| [MongoDB.SetURI](MongoDBSetURI.md)   Sets the URI. | All   12.3 |
| [MongoDB.SetUserName](MongoDBSetUserName.md)   Sets user name for login. | All   12.3 |
| [MongoDB.StartTransaction](MongoDBStartTransaction.md)   Start a multi-document transaction for all following operations in this session. | All   12.5 |
| [MongoDB.TextToBinary](MongoDBTextToBinary.md)   Converts a text to JSON for MongoDB. | All   13.2 |
| [MongoDB.Time](MongoDBTime.md)   Create a new JSON value with given timestamp. | All   13.2 |
| [MongoDB.Trace](MongoDBTrace.md)   Enables or disables trace. | All   13.4 |
| [MongoDB.TransactionState](MongoDBTransactionState.md)   Returns the current transaction state for this session. | All   12.5 |
| [MongoDB.UpdateMany](MongoDBUpdateMany.md)   Updates many documents in collection that matches selector. | All   12.3 |
| [MongoDB.UpdateOne](MongoDBUpdateOne.md)   Updates at most one document in collection that matches selector. | All   12.3 |
| [MongoDB.WatchClient](MongoDBWatchClient.md)   Creates a change stream for a client. | All   13.0 |
| [MongoDB.WatchCollection](MongoDBWatchCollection.md)   Creates a change stream for a collection. | All   13.0 |
| [MongoDB.WatchDatabase](MongoDBWatchDatabase.md)   Creates a change stream for a database. | All   13.0 |

110 functions shown.

These functions require a license (85%).

### Release notes

- **Version 16.0**
    - Deprecated [MongoDB.MaxMessageSize](https://www.mbsplugins.eu/MongoDBMaxMessageSize.shtml) and [MongoDB.MaxBSONSize](https://www.mbsplugins.eu/MongoDBMaxBSONSize.shtml) functions.
    - Rewrote [MongoDB.ClientCommandQuery](https://www.mbsplugins.eu/MongoDBClientCommandQuery.shtml) function.
- **Version 15.0**
    - Added more parameter checks for [MongoDB](https://www.mbsplugins.eu/component_MongoDB.shtml) functions.
- **Version 14.4**
    - Added [MongoDB.CursorRecords](https://www.mbsplugins.eu/MongoDBCursorRecords.shtml) function.
    - Added OptionsJSON parameter for [MongoDB.ReplaceOne](https://www.mbsplugins.eu/MongoDBReplaceOne.shtml) function.
- **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.
    - 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.
- **Version 13.4**
    - Added [MongoDB.IsTracing](https://www.mbsplugins.eu/MongoDBIsTracing.shtml) and [MongoDB.Trace](https://www.mbsplugins.eu/MongoDBTrace.shtml) functions.
    - Added [MongoDB.Ping](https://www.mbsplugins.eu/MongoDBPing.shtml) function.
    - Added [MongoDB.SetSSLOptions](https://www.mbsplugins.eu/MongoDBSetSSLOptions.shtml) function.
    - Added [MongoDB.SSLLibrary](https://www.mbsplugins.eu/MongoDBSSLLibrary.shtml) function.
- **Version 13.2**
    - Added [MongoDB.ContainerToBinary](https://www.mbsplugins.eu/MongoDBContainerToBinary.shtml) and [MongoDB.TextToBinary](https://www.mbsplugins.eu/MongoDBTextToBinary.shtml) functions.
    - Added [MongoDB.NowUTC](https://www.mbsplugins.eu/MongoDBNowUTC.shtml) and [MongoDB.Time](https://www.mbsplugins.eu/MongoDBTime.shtml) function.
- **Version 13.1**
    - Added [MongoDB.Command](https://www.mbsplugins.eu/MongoDBCommand.shtml), [MongoDB.AggregateDatabase](https://www.mbsplugins.eu/MongoDBAggregateDatabase.shtml) and [MongoDB.AggregateCollection](https://www.mbsplugins.eu/MongoDBAggregateCollection.shtml) functions.
    - Added [MongoDB.GetOptions](https://www.mbsplugins.eu/MongoDBGetOptions.shtml), [MongoDB.GetTLS](https://www.mbsplugins.eu/MongoDBGetTLS.shtml) and [MongoDB.SetDatabase](https://www.mbsplugins.eu/MongoDBSetDatabase.shtml) functions.
    - Fixed a bug in [MongoDB.ChangeStreamErrorDocument](https://www.mbsplugins.eu/MongoDBChangeStreamErrorDocument.shtml), [MongoDB.ChangeStreamResumeToken](https://www.mbsplugins.eu/MongoDBChangeStreamResumeToken.shtml) and [MongoDB.NextChange](https://www.mbsplugins.eu/MongoDBNextChange.shtml) functions.
- **Version 13.0**
    - Added functions to watch changes in MongoDB: [MongoDB.ChangeStreamErrorDocument](https://www.mbsplugins.eu/MongoDBChangeStreamErrorDocument.shtml), [MongoDB.ChangeStreamResumeToken](https://www.mbsplugins.eu/MongoDBChangeStreamResumeToken.shtml), [MongoDB.CloseChangeStream](https://www.mbsplugins.eu/MongoDBCloseChangeStream.shtml), [MongoDB.NextChange](https://www.mbsplugins.eu/MongoDBNextChange.shtml), [MongoDB.WatchClient](https://www.mbsplugins.eu/MongoDBWatchClient.shtml), [MongoDB.WatchCollection](https://www.mbsplugins.eu/MongoDBWatchCollection.shtml) and [MongoDB.WatchDatabase](https://www.mbsplugins.eu/MongoDBWatchDatabase.shtml).
- **Version 12.5**
    - Added [MongoDB.StartTransaction](https://www.mbsplugins.eu/MongoDBStartTransaction.shtml), [MongoDB.CommitTransaction](https://www.mbsplugins.eu/MongoDBCommitTransaction.shtml), [MongoDB.InTransaction](https://www.mbsplugins.eu/MongoDBInTransaction.shtml), [MongoDB.AbortTransaction](https://www.mbsplugins.eu/MongoDBAbortTransaction.shtml) and [MongoDB.TransactionState](https://www.mbsplugins.eu/MongoDBTransactionState.shtml) functions.
    - Added [FM.SQL.List](https://www.mbsplugins.eu/FMSQLList.shtml), [JSON.List](https://www.mbsplugins.eu/JSONList.shtml), [Matrix.List](https://www.mbsplugins.eu/MatrixList.shtml), [MongoDB.List](https://www.mbsplugins.eu/MongoDBList.shtml) and [XML.List](https://www.mbsplugins.eu/XMLList.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)
- [MBS Plugin 14.2 for Claris FileMaker](https://www.mbsplugins.de/archive/2024-05-14/MBS_Plugin_142_for_Claris_File/monkeybreadsoftware_blog_filemaker)
- [Can FileMaker do that?](https://www.mbsplugins.de/archive/2024-02-03/Can_FileMaker_do_that/monkeybreadsoftware_blog_filemaker)
- [Send Audit Log via CURL in background](https://www.mbsplugins.de/archive/2023-11-30/Send_Audit_Log_via_CURL_in_bac/monkeybreadsoftware_blog_filemaker)
- [News in MBS FileMaker Plugin 13.4](https://www.mbsplugins.de/archive/2023-09-20/News_in_MBS_FileMaker_Plugin_1/monkeybreadsoftware_blog_filemaker)
- [MBS Plugin 13.4 for Claris FileMaker - More than 7100 Functions In One Plugin](https://www.mbsplugins.de/archive/2023-09-12/MBS_Plugin_134_for_Claris_File/monkeybreadsoftware_blog_filemaker)
- [Thoughts about OnWindowTransaction](https://www.mbsplugins.de/archive/2023-07-01/Thoughts_about_OnWindowTransac/monkeybreadsoftware_blog_filemaker)
- [MBS @ FMTraining.TV - What’s New in the FileMaker MonkeyBread Plug-in - 13.2 Release](https://www.mbsplugins.de/archive/2023-05-21/MBS_@_FMTrainingTV_-_What’s_/monkeybreadsoftware_blog_filemaker)
- [FileMaker and MongoDB](https://www.mbsplugins.de/archive/2023-03-20/FileMaker_and_MongoDB/monkeybreadsoftware_blog_filemaker)
- [MBS @ FMTraining.TV - MBS Plugin 13.1](https://www.mbsplugins.de/archive/2023-03-16/MBS_@_FMTrainingTV_-__MBS_Plug/monkeybreadsoftware_blog_filemaker)

### FileMaker Magazin

- [Ausgabe 1/2025, Seite 23 bis 26](https://filemaker-magazin.de/neuigkeit/4282-Appetithappen-FMM_202501)

### Example Databases

- [MongoDB/MongoDB Audit](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/MongoDB/MongoDB%20Audit.shtml#1ScriptAnchor_)
- [MongoDB/MongoDB Blog](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/MongoDB/MongoDB%20Blog.shtml#1Button92.0000000697.0000000114.0000000825.0000000LayoutObjectAnchor_)
- [MongoDB/MongoDB Test](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/MongoDB/MongoDB%20Test.shtml#8ScriptAnchor_)

[HTML Version](component_MongoDB.shtml)