This page shows the driver syntax for several MongoDB commands and links to their related reference and API documentation.本页显示了几个MongoDB命令的驱动程序语法,并链接到它们的相关参考和API文档。
Compatibility兼容性
You can use the Node.js driver to connect and execute commands for deployments hosted in the following environments:您可以使用Node.js驱动程序连接并执行以下环境中托管的部署的命令:
- MongoDB Atlas
: The fully managed service for MongoDB deployments in the cloud:云中MongoDB部署的完全托管服务 - MongoDB Enterprise
: The subscription-based, self-managed version of MongoDB:MongoDB的基于订阅的自我管理版本 - MongoDB Community
: The source-available, free-to-use, and self-managed version of MongoDB:MongoDB的源代码可用、免费使用和自我管理版本
To learn more about performing common CRUD operations in the Atlas UI for deployments hosted in MongoDB Atlas, see Create, View, Update, and Delete Documents.
| Command | Syntax |
|---|---|
| Find a Document API Documentation Find Documents Guide |
|
| Find Multiple Documents API Documentation Find Documents Guide |
|
| Insert a Document API Documentation Insert Documents Guide | |
| Insert Multiple Documents API Documentation Insert Documents Guide | |
| Update a Document API Documentation Update Documents Guide |
|
| Update Multiple Documents API Documentation Update Documents Guide |
|
| Update Arrays in Documents API Documentation Update Arrays in a Document Guide |
|
| Replace a Document API Documentation Replace Documents Guide |
|
| Delete a Document API Documentation Delete Documents Guide | |
| Delete Multiple Documents API Documentation Delete Documents Guide | |
| Bulk Write API Documentation Bulk Operations Guide |
|
| Watch for Changes API Documentation Monitor Data with Change Streams Guide | |
| Access Data from a Cursor Iteratively Access Data from a Cursor Guide |
|
| Access Data from a Cursor as an Array API Documentation Access Data from a Cursor Guide | const cursor = coll.find();
|
| Count Documents API Documentation Count Documents Guide |
|
| List the Distinct Documents or Field Values API Documentation Retrieve Distinct Values Guide |
|
| Limit the Number of Documents Retrieved API Documentation Limit Documents Reference |
|
| Skip Retrieved Documents API Documentation Skip Documents Reference |
|
| Sort the Documents When Retrieving Them API Documentation Sort Documents Reference |
|
| Project Document Fields When Retrieving Them API Documentation Specify Which Fields to Return Guide |
|
| Create an Index API Documentation Indexes Guide | |
| Query Text API Documentation Query Text Guide |
|
package.json
|