react-native-mmkv-storage
react-native-mmkv-storage copied to clipboard
[Question]how to setArray, query one array item by specific property
Can you provide more details and an example
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.
@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 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.
@cani1see Can you provide an example of data and how you are storing it?