Created
June 11, 2019 20:43
-
-
Save david-mart/e052adfc060837082e55aa6aa12f52bd to your computer and use it in GitHub Desktop.
This file contains 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 order = await UsersDb.models.order.findOne({ where: { id: 1 } }); | |
await order.createProduct({ name: 'oathkeeper' }); | |
await order.createProduct({ name: 'longclaw' }); | |
await order.createProduct({ name: 'needle' }); | |
const products = await order.getProducts(); | |
console.log(products); | |
// output | |
[ { id: 1, order_id: 1, name: 'oathkeeper' }, | |
{ id: 2, order_id: 1, name: 'longclaw' }, | |
{ id: 3, order_id: 1, name: 'needle' } ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment