ChangeFeedPullModelIterator interface
Use Items.getChangeFeedIterator()
to return an iterator that can iterate over all the changes for a partition key, feed range or an entire container.
Properties
has |
Always returns true, changefeed is an infinite stream. |
Methods
get |
Gets an async iterator which will yield change feed results. Example Get changefeed for an entire container from now
|
read |
Returns next set of results for the change feed. |
Property Details
hasMoreResults
Always returns true, changefeed is an infinite stream.
hasMoreResults: boolean
Property Value
boolean
Method Details
getAsyncIterator()
Gets an async iterator which will yield change feed results.
Example
Get changefeed for an entire container from now
const options = { changeFeedStartFrom: ChangeFeedStartFrom.Now() };
for await(const res of container.items.getChangeFeedIterator(options).getAsyncIterator()) {
//process res
}
function getAsyncIterator(): AsyncIterable<ChangeFeedIteratorResponse<(T & Resource)[]>>
Returns
AsyncIterable<ChangeFeedIteratorResponse<(T & Resource)[]>>
readNext()
Returns next set of results for the change feed.
function readNext(): Promise<ChangeFeedIteratorResponse<(T & Resource)[]>>
Returns
Promise<ChangeFeedIteratorResponse<(T & Resource)[]>>