visual-studio-code - 如何在 VS Code 中为 Cosmos DB 执行查询?

标签 visual-studio-code azure-cosmosdb

我已经安装了一个扩展程序,用于在 VS Code 中访问 Microsoft Azure Cosmos DB,并且我能够按预期查看其中的文档。

enter image description here

但是,我无法弄清楚如何运行允许我根据不同条件过滤结果的查询,例如:SELECT * FROM c WHERE c.DocumentId = 123

有没有办法在 Cosmos DB 上的 VS Code 中运行 SQL 查询?我找不到任何有用的教程,通过安装“mssql”扩展似乎主要集中在 ADO.NET 连接上。

最佳答案

基于 cosmos db 扩展中的语句:

Browse and query your MongoDB databases both locally and in the cloud using scrapbooks with rich Intellisense then connect to Azure to manage your Cosmos DB databases with support for MongoDB, Graph (Gremlin), and SQL (previously known as DocumentDB).

您可以按照下面的 Scrapbooks 官方示例使用 mongo shell 语法查询您的 sql api 数据库。

enter image description here

例如

db.coll.find({"DocumentId" :123})

更新:

抱歉更新晚了。我为您准备了 2 个工具:

1.CosmosDbExplorer:https://www.bruttin.com/CosmosDbExplorer/

2.Azure 存储资源管理器:https://azure.microsoft.com/en-us/features/storage-explorer/

enter image description here

关于visual-studio-code - 如何在 VS Code 中为 Cosmos DB 执行查询?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57512744/

相关文章:

visual-studio-code - 我已经设置了 ssh key ,但是 VSCode 一直要求输入密码

visual-studio-code - 如何在 VSC 中停止终端旋转图标

azure - 无法加载 DLL 'Microsoft.Azure.Documents.ServiceInterop.dll' [使用 Microsoft.Azure.DocumentDB 1.17.0]

Azure 机器学习工作室 - 从 Cosmos Db 导入

azure - 使用 Azure CosmosDB 容器将对象移动到不同状态

azure - 在 Azure Functions 应用程序中存储 Azure ConnectionString 的位置

angular - VS code/Angular - Linter 无法识别通过共享模块导入的组件

reactjs - 如何使 VS Code 自动完成 React 组件的 prop 类型?

python - 有什么方法可以使用 vscode 在绘图查看器中显示交互式绘图吗?

sql - 为每个 "Group"选择最新文档