Skip to content

Commit 63e5a04

Browse files
Merge pull request #215897 from gahl-levy/patch-38
Update find-request-unit-charge.md
2 parents 2ad9658 + c3d9317 commit 63e5a04

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

articles/cosmos-db/mongodb/find-request-unit-charge.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ The cost of all database operations is normalized by Azure Cosmos DB and is expr
2020

2121
This article presents the different ways you can find the [request unit](../request-units.md) (RU) consumption for any operation executed against a container in Azure Cosmos DB for MongoDB. If you're using a different API, see [API for NoSQL](../find-request-unit-charge.md), [API for Cassandra](../cassandra/find-request-unit-charge.md), [API for Gremlin](../gremlin/find-request-unit-charge.md), and [API for Table](../table/find-request-unit-charge.md) articles to find the RU/s charge.
2222

23-
The RU charge is exposed by a custom [database command](https://docs.mongodb.com/manual/reference/command/) named `getLastRequestStatistics`. The command returns a document that contains the name of the last operation executed, its request charge, and its duration. If you use the Azure Cosmos DB for MongoDB, you have multiple options for retrieving the RU charge.
23+
The RU charge is exposed by a custom database command named `getLastRequestStatistics`. The command returns a document that contains the name of the last operation executed, its request charge, and its duration. If you use the Azure Cosmos DB for MongoDB, you have multiple options for retrieving the RU charge.
2424

2525
## Use the Azure portal
2626

@@ -42,7 +42,15 @@ The RU charge is exposed by a custom [database command](https://docs.mongodb.com
4242

4343
`db.runCommand({getLastRequestStatistics: 1})`
4444

45-
## Use a MongoDB driver
45+
## Programmatically
46+
47+
### [Mongo Shell](#tab/mongo-shell)
48+
49+
When you use the Mongo shell, you can execute commands by using runCommand().
50+
51+
```javascript
52+
db.runCommand('getLastRequestStatistics')
53+
```
4654

4755
### [.NET driver](#tab/dotnet-driver)
4856

0 commit comments

Comments
 (0)