Access private data from other user in a function

Right now I have a collection with a shared partition between two users. Something like:

“owner1=xxxxx&owner2=zzzzzz”

owner1 is a store… owner2 are customers.

So owner1 (the store) will have several records from different owner2. The customers can only see the records they created for that store.

Example:

record1: _partition: owner1=1111&owner2=2222 …
record2: _partition: owner1=1111&owner2=2222 …
record3: _partition: owner1=1111&owner2=2222 …
record4: _partition: owner1=1111&owner2=3333 …
record5: _partition: owner1=1111&owner2=3333 …

That means that the store(user 1111) has 5 records. The customer1(user 2222) has 3 items for that store, and customer2(user 3333) has 2 items.

I have a function that create those records, and I need to limit the amount of records the store can have.

For example: I want to limit the amount of item to no more than 5. So, in the function, I need to get a count for all the items with _partition = owner=1111&%.

Considering that customer1 cant read the records from customer2, the count will be 3, not 5.

How can I get the correct count without making the customer2 data readable to customer1?