Azure / azure-cosmosdb-js-server

The JavaScript SDK for server-side programming in Azure Cosmos DB
MIT License
179 stars 152 forks source link

Collection.filter returns documents from other partitions #28

Open thomaslevesque opened 6 years ago

thomaslevesque commented 6 years ago

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?

thomaslevesque commented 4 years ago

I can still reproduce this. Guys, this is a serious bug! I reported it more than one year ago. Is nobody monitoring issues in this repo?

cowens-genvidtech commented 2 years ago

This is still occurring, and I agree this is a serious problem.