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
suggestion: using ids as key for objects, instead of using them inside object #28
Comments
great suggestion. 👍 |
@Adwaith-Rajesh what do you think. |
Nice, idea but this change should be a slow one. As currently there are like 1000 ppl using this monthly so when you suddenly change how data is represented this can cause issues with ppl who does not care about the version that they are using. |
Yes. This will change the structure of data stored in db and as @Adwaith-Rajesh said. This will take some time as many projects store data in the current form and changing the structure can cause errors for them. |
#31 closing this now. |
How would this feature be useful?
retrieving object by its id (primary key) in O(1) times instead of O(n) time.
Describe the solution you'd like
currently json file looks like --- { "data": [ { "id": 1, "k1": "v1" }, { "id": 2, "k2": "v2" }] }
it should looks like --- { "data": { "1": {"k1": "v1"}, "2": {"k2": "v2" } } }
now we can fetch single items by its key using db["1"] in O(1) time.
The text was updated successfully, but these errors were encountered: