Overview
使用示例显示可运行的代码示例,以演示常用的 MongoDB 操作。 每个用法示例都包括以下内容:
MongoDB 操作说明
可以在您的环境中运行的异步和同步 Rust 代码示例
代码示例打印的输出
如何使用用法示例
这些用法示例旨在对包含 Atlas 样本数据集的 MongoDB 部署运行操作。 在没有样本数据的情况下运行示例代码时,输出可能不匹配。
Follow this tutorial to set up your MongoDB deployment with the sample data and run the example code in your development environment. Before performing the following actions, ensure that you create an Atlas account and deploy a cluster. For information about setting up an account and a cluster, see the MongoDB Get Started guide.
完成这些步骤后,您可以看到相应用法示例的预期输出部分中描述的输出。