I am tying to query an existing Azure CosmosDB database with NodeJS.
getItems: function (callback) {
var self = this;
var querySpec = {
query: 'SELECT * FROM root'
};
self.client.queryDocuments(self.collection._self, querySpec).toArray(function (err, results) {
if (err) {
console.log(err.body);
callback(err);
} else {
callback(null, results);
}
});
}
For some reason it is keep complaining about Cross Partition Query. I am not really sure what it is. Any ideas where I may find this Partition Key and how to set it? Also, how can I avoid this exception in the query?
Full error message: 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.
P.S. I know there are few similar questions asked already, but none of them addresses with NodeJS.