Skip to content

Transactions & relations #28

@gothy

Description

@gothy

First of all, let me thank you for this cool library :)
Now, I'm really considering using Redis Enterprise as a primary DB in the future projects!

So, my question arises from this section in the readme https://github.com/redis/redis-om-node#-embedding-your-own-logic-into-entities
We can fetch "relations" in our entities, but I'm more interested in updating those relations as a part of a transaction. I can see that currently, saving an entity requires you to call repository.save(entity), but what about related entries? What if I need to update an entity, some sub-entity and commit or discard all of the changes?

It would be cool to have something like

getCurrentClient().startTransaction(() => {
  repository1.save(entity);
  repository2.save(subentity);
}).then(...).catch(...)

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