Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request for Nested Field Indexing Support (Including Array of Objects) #6821

Open
EddiePengg opened this issue Feb 4, 2025 · 3 comments
Open

Comments

@EddiePengg
Copy link

Hello RXDB Team,

I would like to request the feature to support indexing on nested fields, specifically for fields inside arrays of objects. Currently, RXDB doesn't support creating indexes on fields that are nested within arrays, which limits the ability to perform efficient queries on deeply nested data structures.

For example, consider the following structure where orders is an array of objects:

{
  "_id": 1,
  "orders": [
    { "item": "apple", "quantity": 10 },
    { "item": "banana", "quantity": 20 }
  ]
}

In MongoDB, it is possible to create an index on the field orders.item or orders.quantity using dot notation for arrays of objects, allowing for more efficient querying. However, this functionality is currently missing in RXDB.

I believe supporting such nested field indexing would greatly improve the performance for complex queries involving arrays and nested objects.

@EddiePengg
Copy link
Author

I know the pipeline can achieve the same functionality, but I believe nested field indexing can offer more capabilities.

@pubkey
Copy link
Owner

pubkey commented Feb 4, 2025

Yes this is a good point. PR is welcomed. Maybe a good first step would be to add this to the dexie storage and then the others could follow.

Copy link

stale bot commented Feb 11, 2025

This issue has been automatically marked as stale because it has not had recent activity. It will be closed soon. Please update it or it may be closed to keep our repository organized. The best way is to add some more information or make a pull request with a test case. Also you might get help in fixing it at the RxDB Community Chat If you know you will continue working on this, just write any message to the issue (like "ping") to remove the stale tag.

@stale stale bot added the stale label Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants