This is a known issue where JS query api doesn’t treat PK value while queryDocuments implicitly adds to the query.
If you add the PK condition manually to the __.filter it will work.
Thanks.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I've been getting up to speed with Store Procedures with Cosmos DB and I've found that when I execute a sp i wrote the returned docs ignore the partition key value I pass in.
For example, a couple of docs that look something like this (partition key is /city):
{
"projectId": 100,
"projectName": "civil bridge 1",
"city": "chicago"
}
{
"projectId": 101,
"projectName": "civil bridge 2",
"city": "chicago"
}
{
"projectId": 103,
"projectName": "civil bridge 3",
"city": "seattle"
}
The stored procedure is passed in a project name search term as a parameter. So if the term passed in is "bridge" the documents that have the term "bridge" should be returned.
When I execute the stored procedure using "bridge" as the search term and a partition value of "chicago" I would expect to see the first 2 docs returned. However, during my testing I'm seeing all 3 docs returned.
Does anyone know why I'm seeing results from outside the partition I specified when I called the stored procedure?
Thanks,
Mike
This is a known issue where JS query api doesn’t treat PK value while queryDocuments implicitly adds to the query.
If you add the PK condition manually to the __.filter it will work.
Thanks.