Nosql CosmosDB查询多个项目

Nosql CosmosDB查询多个项目,nosql,azure-cosmosdb,oracle-nosql,Nosql,Azure Cosmosdb,Oracle Nosql,您好,我正在使用Azure CosmosDB数据库,试图查询项目中的多个数据。” 集合中有三个数组author\u文档、book\u文档、join\u文档。所有数据都填充在这些数组中。 该集合包含以下数据: [ { "author_documents": [ { "id": "a1", "name": &q

您好,我正在使用Azure CosmosDB数据库,试图查询项目中的多个数据。” 集合中有三个数组author\u文档、book\u文档、join\u文档。所有数据都填充在这些数组中。 该集合包含以下数据:

[
    {
        "author_documents": [
            {
                "id": "a1",
                "name": "Thomas Andersen"
            },
            {
                "id": "a2",
                "name": "William Wakefield"
            }
        ],
        "book_documents": [
            {
                "id": "b1",
                "name": "Azure Cosmos DB 101"
            },
            {
                "id": "b2",
                "name": "Azure Cosmos DB for RDBMS Users"
            },
            {
                "id": "b3",
                "name": "Taking over the world one JSON doc at a time"
            },
            {
                "id": "b4",
                "name": "Learn about Azure Cosmos DB"
            },
            {
                "id": "b5",
                "name": "Deep Dive into Azure Cosmos DB"
            }
        ],
        "joining_documents": [
            {
                "authorId": "a1",
                "bookId": "b1"
            },
            {
                "authorId": "a2",
                "bookId": "b1"
            },
            {
                "authorId": "a1",
                "bookId": "b2"
            },
            {
                "authorId": "a1",
                "bookId": "b3"
            }
        ],
        "id": "33a127b7-a0b6-4207-8092-caf15aaae820",
        "_rid": "......",
        "_self": ".......",
        "_etag": "........",
        "_attachments": ".....",
        "_ts": .....
    },
    {
        "author_documents": [
            {
                "id": "a3",
                "name": "Thomas Andersen"
            }
        ],
        "id": "271ffe0c-56c1-4eec-be6c-a5b1d6ff6e72",
        "_rid": ".......",
        "_self": ".....",
        "_etag": "....",
        "_attachments": "......",
        "_ts": .....
    },
    {
        "book_documents": [
            {
                "id": "b7",
                "name": "Azure Cosmos DB 101"
            }
        ],
        "id": "c88a968e-4d4e-4a25-be6b-4661f314b7c5",
        "_rid": "....",
        "_self": "...",
        "_etag": ".....",
        "_attachments": ".....",
        "_ts": 1619172859
    },
    {
        "joining_documents": [
            {
                "authorId": "a3",
                "bookId": "b7"
            }
        ],
        "id": "9c7279ab-9e13-4a39-b61b-a03ad2b2652a",
        "_rid": "==",
        "_self": "/....",
        "_etag": ".......",
        "_attachments": "......",
        "_ts": .....
    }
]
使用此查询可以正常工作:

SELECT t.authorId,t.bookId,f.name FROM  a 
join f in a.author_documents 
JOIN t IN a.joining_documents  where t.bookId="b2" and f.id = t.authorId
但对于这个问题:

SELECT t.authorId,t.bookId,v.name FROM  a 
JOIN t IN a.joining_documents
join v in a.author_documents  where t.bookId="b7" and v.id = t.authorId
数据库中没有记录。 我对NoSQL数据库一无所知。
为什么我不能查询集合中的多个项目?有可能吗?

容器无法在cosmosdb中的其他容器之间进行通信,因为op说他选择使用MongoDb。我想查询集合中的多个项目,有可能吗?谢谢您的回复,先生。你能给我看看你想要的查询结果的样本吗?你可以更新你的问题,比如:我有一个像xxx这样的文档集合,我想要一个像xxx一样返回结果的查询。最后我发现CosmosDB并不像我想要的那样灵活。容器不能在其他容器之间进行通信。所以我转移到另一个数据库,我是说MongoDB上。好的,没关系。你能删除这个问题吗?