Para agentes de IA: um índice de documentação está disponível em https://www.mongodb.com/pt-br/docs/llms.txt — as versões de markdown de todas as páginas estão disponíveis anexando .md a qualquer caminho de URL.
Menu Docs

Alternar saída de registro $queryStats

MongoDB records $queryStats operations in the deployment logs. By default, MongoDB only logs the invocation of $queryStats operations, not the operation's output. For $queryStats operations that include the transformIdentifiers option, you can specify whether the transformed output is included in the log entry.

A inclusão da saída $queryStats nos registros fornece mais informações sobre operações $queryStats específicas, mas pode impacto negativamente o desempenho do cluster, pois as atualizações de registros consomem mais tempo e recursos.

Quando o MongoDB registra a saída $queryStats , os resultados são editados e anônimos. A saída $queryStats não contém literais ou valores de campo.

Para ver um exemplo de saída $queryStats transformada, consulte Exemplo de transformação.

1
  1. Se ainda não tiver sido exibido, selecione a organização que contém seu projeto no menu Organizations na barra de navegação.

  2. Se ainda não estiver exibido, selecione seu projeto no menu Projects na barra de navegação.

  3. Na barra lateral, clique em Clusters sob o título Database.

    A página Clusters é exibida.

2
3
4
5
6
7
8

Os exemplos a seguir mostram as diferenças nas mensagens de registro quando a saída $queryStats é incluída.

Observação

As entradas de log de exemplo são reformatadas para facilitar a leitura.

{
"t":{"$date":"2023-11-27T20:58:59.212+00:00"},"s":"D1", "c":"QRYSTATS",
"id":7808300, "ctx":"conn31","msg":"Logging invocation
$queryStats","attr":{"commandSpec":{"transformIdentifiers":{"algorithm":"hmac-sha-256","hmacKey":"###"}}
}
{
"t":{"$date":"2023-11-27T20:58:59.212+00:00"},"s":"D1", "c":"QRYSTATS",
"id":7808300, "ctx":"conn31","msg":"Logging invocation
$queryStats","attr":{"commandSpec":{"transformIdentifiers":{"algorithm":"hmac-sha-256","hmacKey":"###"}}
}
{
"t":{"$date":"2023-11-27T20:58:59.212+00:00"},"s":"D3", "c":"QRYSTATS",
"id":7808301, "ctx":"conn31","msg":"Logging all outputs of
$queryStats","attr":{"thisOutput":"{key: {queryShape: {cmdNs: {db:
\"hYt+nW/sr1/Zc3YR8nlGWFoesJdvywkw+cR9rMGzXU4=\", coll:
\"TRx6R3rvstYgX96gNmeOi5E3QVsOqzRbv7A9j3q7OvM=\"}, command: \"find\",
filter: {Wb/Uu22DzKZ/Os+ZvLgPKFKGZPV4cIMZ3Ybv1HfYih4=: {$lt:
\"?date\"}}, projection: {r5zQZllsGoqQuQp4Jm0eH2M6RrMqH84KHowcFaiverg=:
true}, sort: {r5zQZllsGoqQuQp4Jm0eH2M6RrMqH84KHowcFaiverg=: 1}},
readConcern: {}, collectionType: \"nonExistent\"}, metrics:
{lastExecutionMicros: 208, execCount: 21, totalExecMicros: {sum: 6079,
max: 1875, min: 198, sumOfSquares: 4401645}, firstResponseExecMicros:
{sum: 6079, max: 1875, min: 198, sumOfSquares: 4401645}, docsReturned:
{sum: 0, max: 0, min: 0, sumOfSquares: 0}, firstSeenTimestamp:
2023-11-27T19:15:51.317Z, latestSeenTimestamp:
2023-11-27T20:55:51.309Z}, asOf: 2023-11-27T20:58:59.212Z}"}
}
{
"t":{"$date":"2023-11-27T20:58:59.213+00:00"},"s":"D3", "c":"QRYSTATS",
"id":7808301, "ctx":"conn31","msg":"Logging all outputs of
$queryStats","attr":{"thisOutput":"{key: {queryShape: {cmdNs: {db:
\"j+Caz+gxt7vl++gmeCAWrvyhDL17WaNrSIDi6Au7VI0=\", coll:
\"f/LCkK/kVEbt4fk2NNbyDPhxas+kzCLLcVbjeNBbhyg=\"}, let:
{pUZAyEEImSXcu8deG05tfIf6F/H92YsFnkZXIeRQtgc=: \"?number\"}, command:
\"aggregate\", pipeline: [{$group: {_id: \"?number\",
5E6FSc5VxCvIZK0jrqkY3k3aX51jSc73hQwO/8kH0lo=: {$sum: \"?number\"}}}],
explain: true, allowDiskUse: false}, client: {driver: {name:
\"nodejs|mongosh\", version: \"5.1.0\"}, os: {type: \"Darwin\", name:
\"darwin\", architecture: \"arm64\", version: \"22.6.0\"}, platform:
\"Node.js v16.19.1, LE (unified)\", version: \"5.1.0|1.8.0\",
application: {name: \"mongosh 1.8.0\"}}, collectionType: \"collection\",
cursor: {batchSize: \"?number\"}}, metrics: {lastExecutionMicros: 0,
execCount: 1, totalExecMicros: {sum: 0, max: 0, min: 0, sumOfSquares:
0}, firstResponseExecMicros: {sum: 0, max: 0, min: 0, sumOfSquares: 0},
docsReturned: {sum: 0, max: 0, min: 0, sumOfSquares: 0},
firstSeenTimestamp: 2023-11-27T19:31:36.463Z, latestSeenTimestamp:
2023-11-27T19:31:36.463Z}, asOf: 2023-11-27T20:58:59.213Z}"}
}
// Additional $queryStats output...