How to fetch more than 100 records from azure cosmos db using query

Viewed 8036

I want to fetch more than 100 records from azure-cosmos DB using select query.

I am writing a stored procedure and using a select query to fetch the record.

SELECT * FROM activities a

I am getting only 100 records though there are more than 500 records. I am able to get all records usings the setting configuration provided by Azure.

enter image description here

I want to perform the same operation using query or stored procedure. How can I do that ??

Please suggest changes that need to accomplish.

2 Answers

If anyone hits this page, the answers above are obsolete. @azure/cosmos now has some options like below for those who are interested:

const usersQuery = {
        query: "SELECT * FROM c where c.userId = 'someid'" +
            " order by c.userId asc,  c.timestamp asc"
    };
const { resources: users } = await container.items
                .query(usersQuery, { maxDegreeOfParallelism: 5,maxItemCount: 10000 }).fetchNext()

For reference, see here.

Related