Async & Await
Introduction to async and await usage
export async function run() {
// Code here
}export async function run() {
var user = await DB.user.first();
console.log('name:', user.name);
// This doesn't hit the database yet, so does not need `await`
var assignment = DB.assignment.create();
assignment.user(user);
await assignment.save();
}Last updated