MongoDB.CursorID
----------------

Retrieves the cursor id used by the server to track the cursor.

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

MBS( "MongoDB.CursorID"; MongoDBRef ) 

**MBS**( **"MongoDB.CursorID";** /\* Retrieves the cursor id used by the server to track the cursor. \*/  
**$MongoDBRef**) /\* The reference number for the mongo connection.e.g. $MongoDB \*/ 

### Parameters

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

### Result

Returns OK or error.

### Description

Retrieves the cursor id used by the server to track the cursor.  
This number is zero until the driver actually uses a server when executing the query, and after it has fetched all results from the server.  
### Examples

Shows ID of current cursor:

 Show Custom Dialog \[ "Current cursor ID:" ; MBS ( "MongoDB.CursorID"; $mongo ) \]  
### See also

- [MongoDB.CursorMore](MongoDBCursorMore.md)
- [MongoDB.CursorNext](MongoDBCursorNext.md)

This function checks for a license.

Created 22nd May 2022 , last changed 20th June 2022

  
[MongoDB.CursorGetMaxAwaitTimeMS](MongoDBCursorGetMaxAwaitTimeMS.md) - [MongoDB.CursorLimit](MongoDBCursorLimit.md)

[HTML Version](MongoDBCursorID.shtml)