假设我正在使用MongoDB API将以下文档添加到名为“schoolInfo”的CosmosDB集合中 .

var obj1 = {
    "type":"student"
    "studentId": "abc",
    "task_status": [
            {
                "status":"Current",
                "date":516760078
            },
            {
                "status":"Late",
                "date":1516414446
            }
        ],
    "student_plan": "n"
 }

(A)如何创建SQL API Cosmos实例以读取相同的集合数据?

我需要SQL API,因为我需要在Azure函数中读取该数据,并且据此,只有SQL和Graph API可用于Azure Functions . https://docs.microsoft.com/en-us/azure/cosmos-db/serverless-computing-database#comments-container

(B)我如何从SQL API查询?我假设我可以使用 schoolInfo 作为表名,但我如何知道/确保列名可用 - 假设 task_status 是嵌套/数组对象?

任何快速的例子将不胜感激 .