【问题标题】:Equivalent to Mongo DB`s find function in Cosmos DBEquivalent to Mongo DB`s find function in Cosmos DB
【发布时间】:2022-12-02 01:51:58
【问题描述】:

In previous projects, we used MongoDB, and hevily made use of the find(). In our current project, we use Cosmos DB SQL API. We want to run queries similar to db.something.find({age:18}). Is there a way to query the cosmos like the find() function?

【问题讨论】:

  • There are lots of Mongo API functions that don't have builtin equivalents in SQL API But this one seems to be a pretty straightforward one to emulate. Just send it a SELECT ... WHERE age = 18 query.

标签: azure-cosmosdb azure-cosmosdb-sqlapi


【解决方案1】:

Cosmos DB's NOSQL API works differently,

You would just do, NOSQL API supports for querying the items using the structure query language syntax, the equivalent of find would be

SELECT *  FROM Something s WHERE s.age = 18

【讨论】:

    猜你喜欢
    • 2023-02-21
    • 1970-01-01
    • 2019-03-30
    • 2021-11-14
    • 2020-08-03
    • 2021-10-22
    • 2019-06-05
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多