Created
June 16, 2019 16:56
-
-
Save B4nan/2a93a5d812c7efed32be579c91e3547d to your computer and use it in GitHub Desktop.
More complex example of implicit transaction in MikroORM
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const author = await orm.em.findOne(Author, id, ['books.tags', 'books.publisher']); | |
| author.books[0].title = 'New book name'; | |
| author.books[0].tags[0].name = 'old'; | |
| author.books[0].tags.add(new BookTag('sale')); | |
| author.books[0].publisher.name = 'New publisher name'; | |
| await orm.em.flush(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment