db.collection.configureQueryAnalyzer()
Definition
db.collection.configureQueryAnalyzer(options)
Configures query sampling for a collection on a replica set or sharded cluster. Sampled queries provide information to
analyzeShardKey
to calculate metrics about read and write distribution of a shard key.The
db.collection.configureQueryAnalyzer()
method wraps theconfigureQueryAnalyzer
command.Returns: A document containing fields describing the old configuration, if one exists, and fields describing the new configuration. For details, see Output.
Syntax
The method has the following syntax:
db.collection.configureQueryAnalyzer( { mode: <string>, samplesPerSecond: <double> } )
Fields
db.collection.configureQueryAnalyzer()
has the following fields:
Field | Type | Necessity | Description |
---|---|---|---|
mode | string | Required | Mode the query analyzer runs in. Must be set to either
"full" or "off" . |
samplesPerSecond | double | Optional | Number of samples per second.
For details, see samplesPerSeconds Upper Limit. |
Access Control
For details, see configureQueryAnalyzer Access Control.
Behavior
For behavior, see configureQueryAnalyzer Behavior.
Output
For details, see configureQueryAnalyzer Output.
Examples
For examples, see configureQueryAnalyzer Examples.