不要怂,就是干,撸起袖子干!

Commit 6a737fe7 by Zach Azar Committed by GitHub

docs(eager-loading): add await to code example (#13414)

This line is missing an await, so the console.log does not actually log the expected Foo object as it hasn't been retrieved yet.
1 parent bbf3d764
...@@ -378,7 +378,7 @@ await sequelize.sync(); ...@@ -378,7 +378,7 @@ await sequelize.sync();
const foo = await Foo.create({ name: 'foo' }); const foo = await Foo.create({ name: 'foo' });
const bar = await Bar.create({ name: 'bar' }); const bar = await Bar.create({ name: 'bar' });
await foo.addBar(bar); await foo.addBar(bar);
const fetchedFoo = Foo.findOne({ include: Bar }); const fetchedFoo = await Foo.findOne({ include: Bar });
console.log(JSON.stringify(fetchedFoo, null, 2)); console.log(JSON.stringify(fetchedFoo, null, 2));
``` ```
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!