Догађаји
Изградите интелигентне апликације
17. мар 21 - 21. мар 10
Придружите се серији састанака како бисте изградили скалабилна АИ решења заснована на стварним случајевима коришћења са колегама програмерима и стручњацима.
Региструјте се одмахОвај прегледач више није подржан.
Надоградите на Microsoft Edge бисте искористили најновије функције, безбедносне исправке и техничку подршку.
APPLIES TO:
NoSQL
MongoDB
Visual Studio Code is a versatile code editor for Linux, macOS, and Windows, supporting numerous extensions. This quickstart shows you how to connect to Azure Cosmos DB for NoSQL and Azure Cosmos DB for MongoDB (vCore) cluster using Visual Studio Code. It covers performing core database operations, including querying, inserting, updating, and deleting data.
Before you begin, ensure you have the following:
An Azure Cosmos DB account configured with a database and collection for NoSQL API. Use any of these quickstarts below to set up a resource:
To connect and manage data in Azure Cosmos DB within Visual Studio, first install the Azure Databases extension.
The following steps will use the Query Editor to execute a query and view the results of the query:
In the menu for your collection, right-click on the collection to open the Query Editor in Preview.
Run the query provided in the query editor to display your data in Table View:
Explore your data in other supported views:
Within the query editor, view additional query and index metrics to better help optimize your query performance.
For more information on the metric definitions, see the query metrics documentation.
In this tutorial, you've learned how to query data in VS Code, export query results, view query and index metrics for tuning query performance and display data in the multiple supported views. You can now use the Azure Databases VS Code Extension to review real data in your database.
Before you begin, ensure you have the following:
Напомена
Your password is only used for authentication and is not stored.
Напомена
In many corporate environments, developer machine IP addresses are hidden due to a VPN or other corporate network settings. In these cases, it is recommended to start with allowing access to all IP addresses by adding the 0.0.0.0 - 255.255.255.255 firewall rule for connection testing initially before refining the allow-list.
Easily manage your databases within Visual Studio Code:
Create and Drop Databases/Collections: Right-click on your account, database, or collection in the resource panel to create or delete databases and collections.
Import from JSON: Quickly import data from JSON files into your collection.
Export Data: Save collections or query results as JSON for backup or sharing.
Real-Time Document Editing: Instantly add, view, edit, and delete documents with real-time updates.
Run and refine your queries seamlessly:
Instant Results: Immediately view query results in your preferred format—Table, JSON, or Tree view.
Execute Queries Directly: Write and execute MongoDB queries with features like syntax highlighting and autocompletion.
Ctrl/Cmd+Enter
in the query editor.Напомена
Currently, only find filter queries are supported, with expanded query capabilities coming soon.
Explore your data using multiple views for different perspectives:
Table View: Quickly scan data and drill down into nested documents.
Command-line functionality is available:
mongosh
: Execute advanced MongoDB commands directly from Visual Studio Code.Напомена
The MongoDB shell (mongosh
) is not included with the extension. It must be installed separately and configured manually.
Stay on top of your resources:
View Cluster Details: Check your cluster’s tier, server version, and resource usage.
Manage Tags: Organize your clusters with tags that sync with the Azure Portal.
Догађаји
Изградите интелигентне апликације
17. мар 21 - 21. мар 10
Придружите се серији састанака како бисте изградили скалабилна АИ решења заснована на стварним случајевима коришћења са колегама програмерима и стручњацима.
Региструјте се одмахОбука
Модул
Get started with the MongoDB API in Azure Cosmos DB - Training
Learn Azure Cosmos DB for MongoDB basics.
Цертификација
Microsoft Certified: Azure Cosmos DB Developer Specialty - Certifications
Write efficient queries, create indexing policies, manage, and provision resources in the SQL API and SDK with Microsoft Azure Cosmos DB.