8000 Add new index key function · Issue #7 · jmsv/oaty · GitHub
[go: up one dir, main page]

Skip to content

Add new index key function #7

Open

Description

@jmsv

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

e.g.:

oaty.addKey('colour')
oaty.get('colour', 'blue')

Activity

  1. j-m commented on May 12, 2019

    @j-m
    Collaborator

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0