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

Add new index key function #7

Open
jmsv opened this issue May 9, 2019 · 1 comment
Open

Add new index key function #7

jmsv opened this issue May 9, 2019 · 1 comment

Comments

@jmsv
Copy link
Owner

jmsv commented May 9, 2019

Add a new indexing key that wasn't specified at constructor time

e.g.:

oaty.addKey('colour')
oaty.get('colour', 'blue')
@j-m
Copy link
Collaborator

j-m commented May 12, 2019

If we did this I think we shoud also create a removeKey. But what should we do with the data that has already been transposed? We may have to add options to it like removeKey('color, { delete: true }).

We also have a similar problem with addKey. The way you've described it is that if someone added a key after adding all the data then that key would have a transpoition of all exisiting data already. Which means that we would either have to transpose all keys as we go (which we do on redesign unless you specify options.keys) or transpose the entirety of original again, which would be costly.

I don't think we should do this.
If someone specifies options.key then they must stick to that and, if they don't, then all keys are transposed anyway in redesign.

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