NoSQL Query Editor shows empty result
How to reproduce:
- Connect to collection which has only 10 documents
- Change
Page sizeto 10 in toolbar - Run query
SELECT * FROM c - Click on
Go to the next page
Expected:
- Button is disabled, since collection has only 10 records and all of them were shown
Actual:
- Button is enabled
- Second page shows
No data to display
Additional:
- If run query
SELECT TOP 10 * FROM cthe button is disabled
@bk201- is this an issue with the SDK? Or why the external tag?
@sajeetharan Could you please take a look? The container has only 10 records, when I run query I create the iterator and call fetchNext(). I set the following options for iterator
this.iterator = client
.database(this.databaseId)
.container(this.containerId)
.items.query<QueryResultRecord>(this.query, {
abortSignal: this.abortController.signal,
populateQueryMetrics: true,
populateIndexMetrics: true,
maxItemCount: isFetchAll // false
? undefined
: (this.resultViewMetadata?.countPerPage ?? DEFAULT_PAGE_SIZE), // I want to receive only 10 therfore set this to 10
maxDegreeOfParallelism: 1000,
bufferItems: true,
forceQueryPlan: true,
});
In response I see that hasMoreResults is true, however container has only 10 records, it should be false.
@bk201- which SDK version is getting used? Could you share with us a repro scenario? (Tell us the container config - number of partitions)
@amanrao23 Sorry, missed your message. SDK - any v4, I 100% sure that this behavior has been repeated since v4.3, at actual v4.7 the same error. If you have access to subscription cosmosdb-portalteam-generaltest-msft you can find there resource group rg-dshilov-test then dshil-nosql-01 then database ToDoList then container PartitionKey_3. There are exactly 10 records. Then call
client
.database('ToDoList')
.container('PartitionKey_3')
.items.query<QueryResultRecord>('SELECT * FROM c', {
populateQueryMetrics: true,
populateIndexMetrics: true,
maxItemCount: 10,
maxDegreeOfParallelism: 1000,
bufferItems: true,
forceQueryPlan: true,
}).fetchNext()
In the response the hasMoreResults will be true. if I'm not mistaken due to continuationToke (if it exists then hasMoreResults is true).