liveBook · Manning

Collection

As explained in Bootstrapping Microservices, Second Edition: With Docker, Kubernetes, GitHub Actions, and Terraform

A MongoDB collection is a group of related documents within a database.

A MongoDB collection stores related documents inside a database. In a development workflow, create a collection, load representative records, and let the application retrieve them through the MongoDB driver. section 4.5.2

A practical development setup follows these steps:

  • Create a database such as video-streaming and a videos collection with Studio 3T. section 4.5.2

Fixture-backed videos collection

A test fixture can populate the videos collection with metadata for two videos. Store static records as JSON, or export JavaScript objects when dynamic identifiers or generated data are useful. The fixture filename identifies the collection, while its directory identifies the fixture’s purpose. section 10.7.1

How Bootstrapping Microservices, Second Edition: With Docker, Kubernetes, GitHub Actions, and Terraform covers it

How deep it goes
Explains creation, document insertion, driver access, and fixture loading without detailing collection internals.
Examples
Demonstrates a videos collection containing video metadata and fixtures written as JSON or JavaScript.
What it assumes
Assumes a running MongoDB server, Docker Compose, and basic application configuration through database connection variables.
What you can do after
Operate collections by creating them, inserting records with Studio 3T, and accessing them through the MongoDB Node.js driver.
How it connects
Connects collections with MongoDB databases, documents, MongoDB drivers, Docker Compose, and database fixtures.

Also explained in

Compare how 16 books explain collection →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Bootstrapping Microservices, Second Edition: With Docker, Kubernetes, GitHub Actions, and Terraform. The section links point to the parts of the book it draws on.