question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cross partition query is required but disabled

See original GitHub issue

How do I fix this in my query? Cross partition query is required but disabled. Please set x-ms-documentdb-query-enablecrosspartition to true, specify x-ms-documentdb-partitionkey, or revise your query to avoid this exception

const querySpec = { query: "SELECT * FROM c WHERE c.documentId = @documentId", parameters: [ { name: "@documentId", value: documentId } ] };

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5

github_iconTop GitHub Comments

10reactions
donniekerrcommented, Oct 8, 2018

sorry, found the answer already. const { result: results } = await container.items .query(querySpec, { enableCrossPartitionQuery: true }) .toArray();

Closing.

2reactions
aeroneer1commented, Dec 13, 2018

This just helped me fix my problem, thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

CosmosDB: Cross partition query is required but disabled ...
Enabling or disabling cross partition query in the CosmosDB settings (using Azure, data explorer) doesn't resolve the problem. [bug].
Read more >
c# - Cross partition query is required but disabled trouble on ...
Hi, what about adding new FeedOptions { EnableCrossPartitionQuery = true }?. – Prasanth V M. Sep 12, 2017 at 13:32. 3.
Read more >
Cross partition query is required but disabled. Please set x-ms ...
I have a Azure Cosmos DB container in Azure partitioned by 'ticker'. I am using the python SDK to try and make a...
Read more >
Problem writing to Azure Cosmos DB - FME Community
The message from the server is: 'Cross partition query is required but disabled. Please set x-ms-documentdb-query-enablecrosspartition to ...
Read more >
Mahesh Sabnis on Twitter: "@rimmanehme Can you help me ...
Can you help me on BadRequestException: Cross partition query is required but disabled.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found