Sampling采样

Sampling in MongoDB Compass is the selection of a subset of documents from a collection for analysis. MongoDB Compass中的采样是从集合中选择文档子集进行分析。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. Compass使用采样来提高效率。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.分析大样本或整个采集需要更多的时间和处理能力。

MongoDB Compass samples 1,000 documents from a collection using the $sample operator via the aggregation pipeline. MongoDB Compass使用$sample运算符通过聚合管道从集合中采集1000个文档。This provides efficient, random sampling without replacement over an entire collection, or over the subset of documents specified by a query.这提供了对整个集合或查询指定的文档子集的高效随机抽样,而无需替换。