如何使用 Mongo API 从 Cosmos DB 获取集合名称
How to get Collections name from Cosmos DB using Mongo API
- 我正在尝试执行 Mongo API 以在 Azure Cosmos-DB 上执行 CRUD 操作。
- 我是 运行 Azure 数据资源管理器上的查询。
- 这是我正在执行的查询
{db.getCollectionNames()}
- 我正面临
{"code":500,"body":"{\"message\":\"There was an error processing your request. Please try again in a few moments.\",\"httpStatusCode\":\"InternalServerError\",\"xMsServerRequestId\":null,\"stackTrace\":null}"}
如果我在这里做错了,你能提出修改建议吗?
Mongo Query
区域与本地 MongoDB shell 不同。也就是说,您在查询 window 中唯一可以做的就是执行 find()
查询,并且您只指定过滤(在 {}
之间)。例如:
还可以通过浏览器打开 mongo shell,您可以在其中 运行 以 mongo 的更传统格式进行查询:
使用基于浏览器的 shell,您还可以进行更新(例如 db.families.update()
)和删除(db.families.remove()
)。但不支持db.getCollectionNames()
.
等命令
- 我正在尝试执行 Mongo API 以在 Azure Cosmos-DB 上执行 CRUD 操作。
- 我是 运行 Azure 数据资源管理器上的查询。
- 这是我正在执行的查询
{db.getCollectionNames()}
- 我正面临
{"code":500,"body":"{\"message\":\"There was an error processing your request. Please try again in a few moments.\",\"httpStatusCode\":\"InternalServerError\",\"xMsServerRequestId\":null,\"stackTrace\":null}"}
如果我在这里做错了,你能提出修改建议吗?
Mongo Query
区域与本地 MongoDB shell 不同。也就是说,您在查询 window 中唯一可以做的就是执行 find()
查询,并且您只指定过滤(在 {}
之间)。例如:
还可以通过浏览器打开 mongo shell,您可以在其中 运行 以 mongo 的更传统格式进行查询:
使用基于浏览器的 shell,您还可以进行更新(例如 db.families.update()
)和删除(db.families.remove()
)。但不支持db.getCollectionNames()
.