VOOZH about

URL: https://www.mongodb.com/docs/compass/sampling/

⇱ Sampling - Compass - MongoDB Docs


Docs Menu

Sampling

MongoDB Compass Readonly Edition will be deprecated in a future release. To replicate the read-only behavior in a standard Compass edition, assign users read access at the database level and enable the readOnly option in Compass.

Sampling in MongoDB Compass is the selection of a subset of documents from a collection for analysis. Analyzing a sample set of data is a common statistical analysis technique; the results of analyzing a sample set tend to be similar to the results of analyzing an entire data set.

Compass uses sampling for efficiency. Generally, standard sample sets can be selected and analyzed in a few seconds. Analyzing large samples or entire collections demands significantly more time and processing power.

Sampling Method

MongoDB Compass samples 1,000 documents from a collection using the $sample operator via the aggregation pipeline. This provides efficient, random sampling without replacement over an entire collection, or over the subset of documents specified by a query.