Programming MongoDB with Mongoose. LiveDemos call same-origin /api/lab6 so they render without a local mongod. The sibling Express server implements the same routes with Mongoose when DATABASE_CONNECTION_STRING is set, and the Chapter 5 in-memory arrays otherwise.
MongoDB connection
Students set DATABASE_CONNECTION_STRING on Express. This demo reports the same-origin Lab 6 store the book uses when Mongo is not configured.