简体   繁体   English

使用“Container.GetItemLinqQueryable”和“Container.GetItemQueryIterator”有什么区别?

[英]What is the difference between using "Container.GetItemLinqQueryable" and "Container.GetItemQueryIterator"?

I was wondering what was the difference (performance or something else) between using either of these methods to query a cosmo container, other than using LINQ vs SQL and assuming that I use the ToFeedIterator() method like mentioned in the docs (also below in case it changes) for Container.GetItemLinqQueryable .我想知道除了使用 LINQ 和 SQL 之外,使用这些方法中的任何一种来查询 cosmo 容器之间有什么区别(性能或其他),并假设我使用文档中提到的ToFeedIterator()方法(也在下面情况下它改变)对于Container.GetItemLinqQueryable

// LINQ query generation
using (FeedIterator<Book> setIterator = container.GetItemLinqQueryable<Book>()
                     .Where(b => b.Title == "War and Peace")
                     .ToFeedIterator())
{                   
    //Asynchronous query execution
    while (setIterator.HasMoreResults)
    {
        foreach(var item in await setIterator.ReadNextAsync())
        {
            Console.WriteLine(item.Price); 
        }
    }
}

Container.GetItemLinqQueryable - Container.GetItemLinqQueryable -
This method creates a LINQ query for items in an Azure Cosmos DB service under a container.此方法为容器下的 Azure Cosmos DB 服务中的项目创建 LINQ 查询。 For asynchronous execution with FeedIterator, utilise the IQueryable extension function ToFeedIterator().对于 FeedIterator 的异步执行,使用 IQueryable 扩展 function ToFeedIterator()。

Container.GetItemQueryIterator - Container.GetItemQueryIterator -
Using a SQL statement, this method creates a query for items under a container in an Azure Cosmos database.此方法使用 SQL 语句创建对 Azure Cosmos 数据库中容器下项目的查询。 It returns a FeedIterator.它返回一个 FeedIterator。

Please refer these links for more information:请参考这些链接以获取更多信息:
Container.GetItemLinqQueryable Container.GetItemLinqQueryable
Container.GetItemQueryIterator Container.GetItemQueryIterator

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Beanstalk 中的 commands 和 container_commands 配置键有什么区别? - What is the difference between commands and container_commands configuration keys in Beanstalk? SAM 应用程序中的 PackageType: Image 和 build --use-container 之间有什么区别? - What is the difference between PackageType: Image and build --use-container in a SAM App? 在 App Engine 和 Compute Engine 中启动 docker 容器有什么区别? - What's the difference between launching a docker container in App Engine vs Compute Engine? 使用 ServiceBusMessageBatch 和在 TransactionScope 中发送多条消息有什么区别? - What is the difference between using a ServiceBusMessageBatch and sending multiple messages in a TransactionScope? gcloud 和 gsutil 有什么区别? - What is the difference between gcloud and gsutil? 使用 powershell 获取 Cosmosdb 容器集合项 - Get Cosmosdb Container Collection items using powershell IContainerGroup.State 属性的可能值是什么? 将 azure sdk 用于 azure 中的容器组 - what are the possible values for IContainerGroup.State property? using azure sdk for container groups in azure 使用列表和 pcollection 的区别 - Difference between using a list or a pcollection getIdToken 和 getAppCheckToken 有什么区别? - What is difference between the getIdToken and getAppCheckToken? 如果更改项目名称,Google Container Registry 会面临哪些风险? - What are the risks to Google Container Registry if the project name is changed?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM