diff --git a/src/content/docs/workers/testing/miniflare/storage/d1.md b/src/content/docs/workers/testing/miniflare/storage/d1.md index 15ef113ef76a48b..341db5d4da3e682 100644 --- a/src/content/docs/workers/testing/miniflare/storage/d1.md +++ b/src/content/docs/workers/testing/miniflare/storage/d1.md @@ -11,9 +11,9 @@ Specify D1 Databases to add to your environment as follows: ```js const mf = new Miniflare({ - d1Databases: { - DB: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", - }, + d1Databases:{ + DB:"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" + } }); ``` @@ -24,7 +24,8 @@ bound to a Worker. You can do this with the `getD1Database` method: ```js const db = await mf.getD1Database("DB"); -const { results } = await db.prepare(""); +const stmt = await db.prepare(""); +const returnValue = await stmt.run(); -console.log(await res.json(results)); +return Response.json(returnValue.results); ```