MCPcopy Index your code
hub / github.com/dev-mastery/comments-api / update

Function update

src/data-access/comments-db.js:65–71  ·  view source on GitHub ↗
({ id: _id, ...commentInfo })

Source from the content-addressed store, hash-verified

63 }
64
65 async function update ({ id: _id, ...commentInfo }) {
66 const db = await makeDb()
67 const result = await db
68 .collection('comments')
69 .updateOne({ _id }, { $set: { ...commentInfo } })
70 return result.modifiedCount > 0 ? { id: _id, ...commentInfo } : null
71 }
72 async function remove ({ id: _id }) {
73 const db = await makeDb()
74 const result = await db.collection('comments').deleteOne({ _id })

Callers

nothing calls this directly

Calls 1

makeDbFunction · 0.70

Tested by

no test coverage detected