I just noticed that Collection.filter returns documents from other partitions.
I have a SP in a partitioned collection. The client specifies the partition key when calling the SP. However, a query like this:
var result = __.filter(
doc => doc.type === 'foo',
callback);
returns documents from other partitions.
On the other hand, an equivalent query using queryDocuments only returns documents from the current partition, as expected:
var result = __.queryDocuments(
__.getSelfLink(),
"select * from c where c.type = 'foo'",
callback);
Honestly, a bug like this is really scary. SP are supposed to run in the context of a single partition. How is it even possible that I get results from other partitions?
I just noticed that
Collection.filter
returns documents from other partitions.I have a SP in a partitioned collection. The client specifies the partition key when calling the SP. However, a query like this:
returns documents from other partitions.
On the other hand, an equivalent query using
queryDocuments
only returns documents from the current partition, as expected:Honestly, a bug like this is really scary. SP are supposed to run in the context of a single partition. How is it even possible that I get results from other partitions?