Skip to content

Instantly share code, notes, and snippets.

@B4nan
Created February 6, 2022 11:59
Show Gist options
  • Save B4nan/8d052e0191413105ede080f889e7afad to your computer and use it in GitHub Desktop.
Save B4nan/8d052e0191413105ede080f889e7afad to your computer and use it in GitHub Desktop.
const book = await em.findOneOrFail(Book, 1, { populate: ['author'] });
// update existing book's author's name
wrap(book).assign({
author: {
name: 'New name...',
},
}, { updateByPrimaryKey: false });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment