Project: Blog Data
Posts with embedded comments.
Example
db.posts.insertOne({
title: "Hello",
tags: ["intro"],
comments: [{ by: "Zara", text: "Nice" }]
})
db.posts.updateOne({ title: "Hello" }, { $push: { comments: { by: "Kofi", text: "Hi" } } })Exercise
Add comment.
{ : { comments: c } }
Quiz Test
These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.