se.</p>
<p>Finally, let&#39;s implement the database access logic inside each of these 4 functions:</p>
<pre><code class="language-js">// todo.js
const { status, json } = require(&#39;server/reply&#39;);
const Todo = require(&#39;./model&#39;);

exports.read = async (ctx) =&gt; {
  return Todo.find().sort(&#39;done&#39;).lean().exec();
};

exports.create = async (ctx) =&gt; {
  const item = new Todo({ text: ctx.data.text });
  return status(201).json(await item.save());
};

exports.update = async (ctx) =&gt