I'm using CosmosDB for the first time, and I am attempting to read a single document by id, according to this documentation:
According to this documentation, my container object should have a ReadItemAsync method that I can use to find and read a single item. However, when I import the "Microsoft.Azure.Cosmos" nuget package to my project and attempt to use this code snippet, there is no function on the container for ReadItemAsync. Here is a snippet of my code:
using Microsoft.Azure.Cosmos;
...
var databaseId = "{databaseId}";
var containerId = "{containerId}";
var client = new CosmosClient(model.IndexDatabaseUri, model.IndexDatabasePrimaryKey);
var database = client.GetDatabase(databaseId);
var container = database.GetContainer(containerId);
var call = container... // NO ReadItemAsync HERE
I do see these functions on the container:
GetItemLinqQueryable
GetItemQueryIterator
GetItemQueryStreamIterator
From the looks of it, I could probably create a query iterator with a custom SELECT statement, and retrieve the first item in the iterator. But that seems overkill for what I am wanting to do. I will always only want a single item in this instance. Why is there no ReadItemAsync method here, when it shows in the documentation that there should be one? And, if the "Iterator" is the new, preferred method, are there any performance considerations in using QueryIterator vs retrieving a single document? This function will be run millions of times over the span of one day.
p.s. - I am using the "Microsoft.Azure.Cosmos" nuget package v3.9.1
