Skip to content

Feature Request: Conditional Operations #16

@amaster507

Description

@amaster507

I am thinking of a use case for this database, and one point is building a layer of abstration on top of this underlying simplicity. One of my goals is to reduce the data footprint by storing data with singularity. In order to do that though, I would need to be able to do a single operation where I have a value and I want to either insert it as a new item and return the item id, or if it already exists, I want to return the item id of the existing item and not insert it.

Here is what that might look like in TySON:

collection|strings|:q[
  find[
    eq{root:s|foo|}
  ],
  if[
    lt{count:n|1|},
    insert[s|foo|]
  ]
]

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions