Challenge 1: Connect and Insert — Possible Solution ==================================================================== const { MongoClient } = require("mongodb"); const client = new MongoClient("mongodb://localhost:27017"); await client.connect(); const db = client.db("library"); const books = db.collection("books"); await books.insertOne({ title: "Deep Learning Foundations", author: "Jane Smith" }); WHY THIS WORKS AS AN ANSWER ------------------------------ This follows the exact sequence the chapter's own example demonstrated: create a MongoClient with the local connection string, await connect() before doing anything else (the connection must be established first), then select the specific database with client.db("library") — this mirrors the mongosh "use library" command from Chapter 2, just expressed as a method call in code rather than a shell command — and finally call insertOne() on the books collection, the same driver method whose mongosh equivalent was covered back in Chapter 3.