ObjectId list does not load all data

Good morning/afternoon/evening everyone!

Thank you in advance for your support.

I’m facing an issue where the entire list of ObjectIDs in the collections I need to load into the app is not being retrieved. I’m using Realm with Flutter and the DeviceSync feature to keep the data updated.

According to the Realm documentation, I understand that for any query I want to be real-time, it needs to be subscribed before being used in the project.

Below, I have the data related to the collections that are being returned according to the query I used in the Compass application.

Below, I provide the reference of the ObjectIDs that I am using to list the information mentioned above in Compass.
Captura de Tela 2024-08-13 às 20.58.07

As shown in the first image above, the first collection has a list of service_providers with a total of 9 items. However, during synchronization to my device, only 3 records are being returned in the ObjectID list. I navigated through the project and there is no filtering or any other operation that would limit the results to only 3 items.

Below, I have included an image of my console and the command I execute to download the data to the device.

Below, I provide the reference of the class I use to map the collection in Mongo.
Captura de Tela 2024-08-13 às 20.04.59

One question that remains is whether there is some kind of limitation on the number of records. Do I need to apply any other processing to load the entire ObjectID list?

Once again, thank you all for your support.
Have a great week.

P.S.
Please forgive any mistakes in my English.
I am not a native speaker and am still learning the language.
I apologize if I was disrespectful in any way, that was never my intention.

Welcome to the forums.

Why are you storing ObjectId’s in the service_providers list instead of a references to the objects themselves?

Those are two different lists and appear to be unrelated; one is a Realm object property called service_providers and the other looks like a var called listCustomersId.

In fact those two hold completely different types of data - service_providers is a ObjectId type and listCustomersId holds a primitive String type.

The image below is a screenshot I took from my code editor.

In the Atlas console image (first image in this message), the service_providers attribute has only 1 record, but in the second image, it shows that there are 3 linked items.

Does it have some kind of cache?

Currently, I am using the integration with Realm version 3.4.0 (updated yesterday) with Flutter (version 3.22).

Once again, thank you very much for responding to the message.

Hello,

Thank you for responding.

Regarding your question, the result in the listCustomersId variable is the list of customers I use to query the database using the IN clause.

In this case, I am using the mutableSubscriptions feature to keep the data synced with the server.

The problem is that the data within service_providers is not updating in the app.

I have conducted various tests in the project and made modifications directly to the database as well.

Currently, I made a change directly to the database (Atlas console) and removed some records from the ObjectID list that is in the service_providers attribute.

I left only 1 record in the ObjectID list (linked to the service_providers attribute), but it is still returning 3 records.

Below, I have included an example image taken from the Atlas console.
Captura de Tela 2024-08-14 às 16.10.39