MongoDB.ClientCommandQuery
--------------------------

Creates a query cursor.

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

### Deprecated

This function was [deprecated](deprecated.md).

MBS( "MongoDB.ClientCommandQuery"; MongoDBRef; dbName; Query ) 

**MBS**( **"MongoDB.ClientCommandQuery";** /\* Creates a query cursor. \*/  
**$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. \*/ 

### 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. |  |

### Result

Returns OK or error.

### Description

Creates a query cursor.  
This function creates a cursor which will execute the command when [MongoDB.CursorNext](MongoDBCursorNext.md) is called on it. The client’s read preference, read concern, and write concern are not applied to the command, and [MongoDB.CursorNext](MongoDBCursorNext.md) will not check the server response for a write concern error or write concern timeout.  
### See also

- [MongoDB.ClientCommand](MongoDBClientCommand.md)
- [MongoDB.CursorNext](MongoDBCursorNext.md)

### Release notes

- **Version 16.0**
    - Rewrote [MongoDB.ClientCommandQuery](https://www.mbsplugins.eu/MongoDBClientCommandQuery.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.

### Blog Entries

- [MBS FileMaker Plugin, version 15.6pr1](https://www.mbsplugins.de/archive/2025-12-01/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [News in MBS FileMaker Plugin 14.2](https://www.mbsplugins.de/archive/2024-05-21/News_in_MBS_FileMaker_Plugin_1/monkeybreadsoftware_blog_filemaker)
- [Neues MBS Plugin 14.2 für Claris FileMaker](https://www.mbsplugins.de/archive/2024-05-14/Neues_MBS_Plugin_142_für_Clar/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)
- [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 30th November 2025

  
[MongoDB.ClientCommand](MongoDBClientCommand.md) - [MongoDB.ClientCommandWithServerId](MongoDBClientCommandWithServerId.md)

[HTML Version](MongoDBClientCommandQuery.shtml)