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

[Question]how to setArray, query one array item by specific property #262

Open
cani1see opened this issue Jun 10, 2022 · 5 comments
Open

Comments

@cani1see
Copy link

No description provided.

@ammarahm-ed
Copy link
Owner

Can you provide more details and an example

@cani1see
Copy link
Author

Can you provide more details and an example

In the document only shows setArray then getArray, but mostly query one item (by id meybe) is all we need.
If instead use id as key to setMap, I find it's very cpu comsuming when the array is large.

@ammarahm-ed
Copy link
Owner

@cani1see you should organize your database in a better way to improve performance of key-value store. The best way is to index items by id and then save each item separately instead of in a one big array. Keep an array of all keys which can be used to find items you need later.

@cani1see
Copy link
Author

@cani1see you should organize your database in a better way to improve performance of key-value store. The best way is to index items by id and then save each item separately instead of in a one big array. Keep an array of all keys which can be used to find items you need later.

as long as I'm setting array item separately, I find it's very time consuming when the array length is large, I think it would be better if there is a way to pass the array once, let the looping happen in native side.

@ammarahm-ed
Copy link
Owner

@cani1see Can you provide an example of data and how you are storing it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants