Collection
A collection is a container or abstraction that groups multiple elements for storage, access, traversal, or processing.
Kotlin in Action, 2E
A collection is a container or aggregate that holds multiple elements and supports operations such as membership testing.
- How it is used
- Uses collections as the main domain for concise Kotlin functions and lambda-based data operations.
- How deep it goes
- Explains creation, operations, mutability contracts, Java correspondence, and lazy sequences without detailing implementation internals.
- Examples
- Demonstrates lists, sets, maps, indexed access, map iteration, and copying from a read-only source into a mutable target.
- What you can do after
- Apply it via Kotlin standard-library functions to create, transform, aggregate, inspect, and safely pass collections.
MongoDB 8.0 in Action, Third Edition
A collection is MongoDB's logical container for related documents.
- How it is used
- Organizes BSON documents within a database and provides the unit for collection options and sharding.
- How deep it goes
- Explains creation, inspection, naming, namespaces, and specialized options with shell commands; does not detail collection storage internals.
- Examples
- Uses sample_mflix collection listings, a namespace lookup, and a db.createCollection() time-series command.
- What you can do after
- Operate/configure collections in mongosh by listing them, inspecting their options, and choosing automatic or explicit creation.
Read how MongoDB 8.0 in Action, Third Edition explains collection →
100 Java Mistakes and How to Avoid Them
A collection is an object representing a group of elements managed through Java's collection abstractions.
- How it is used
- Frames collections as Java abstractions whose lookup, null, mutation, and iteration behavior can produce subtle bugs.
- How deep it goes
- Explains concrete failure modes and prevention rules, while deferring complete mutability classification and complex static analysis.
- Examples
- Uses a List passed to generic varargs, null searches after Set.of() migration, and a sanitizer returning emptyList().
- What you can do after
- Diagnose/debug collection bugs involving silent misses, null queries, equality, and unexpected unsupported mutations.
Read how 100 Java Mistakes and How to Avoid Them explains collection →
AI-Powered Search
A collection is a logical search-engine unit that contains a schema and configuration and holds indexed documents for searching and retrieval.
- How it is used
- Uses collections as indexed units for document retrieval, ranking, and entity lookup.
- How deep it goes
- Defines collections and demonstrates creation, indexing, and searching; leaves finite-state transducer internals unexplained.
- Examples
- Indexes outdoors questions and answers, loads entity and city data, and ranks sample documents for “the cat in the hat.”
- What you can do after
- Operate/configure collections by creating them, loading documents, issuing searches, and inspecting score explanations.
ScyllaDB in Action
A collection type is a ScyllaDB data type that stores multiple related values, such as set elements or map key-value pairs, in a single column value.
- How it is used
- Selects column types for aggregating small related values in a query-first ScyllaDB schema.
- How deep it goes
- Defines LIST, SET, and MAP, then demonstrates declarations and update operations; defers large or unbounded data to separate tables.
- Examples
- Uses a collections table, unique text sets, editable text maps, and an article image gallery modeled as SET<FROZEN<image>>.
- What you can do after
- Apply it via CQL by choosing, declaring, and updating LIST, SET, or MAP columns for bounded related data.
Clojure: The Essential Reference
A Java collection is an object from Java's collection abstractions that stores or organizes multiple values.
- How it is used
- Enables Clojure collection-processing functions to work with supported Java collections and other container types.
- How deep it goes
- Explains `count` and `set` contracts and selected performance differences, without detailing Java collection interfaces.
- Examples
- Uses vector counting, duplicate removal with `set`, and command-line argument checking; provides no concrete Java collection example.
- What you can do after
- Apply it via Clojure’s `count` and `set` to inspect or transform supported collections, including common Java iterable inputs.
Read how Clojure: The Essential Reference explains collection →
The Well-Grounded Rubyist, Fourth Edition
A collection is an object that groups multiple elements and supports operations for examining or traversing those elements.
- How it is used
- Organizes objects for searching, sorting, filtering, traversal, and transformation across Ruby’s core data structures.
- How deep it goes
- Explains major classes, each-based iteration, Enumerable’s contract, filtering results, and Enumerator laziness without exhaustive API coverage.
- Examples
- Uses array traversal, a custom each implementation, conference payment filtering, numeric selection, and lazy slice-map chains.
- What you can do after
- Apply it via each, Enumerable methods, and Enumerator chains to traverse, select, transform, and process grouped objects.
Read how The Well-Grounded Rubyist, Fourth Edition explains collection →
Build an Advanced RAG Application (From Scratch)
A document collection is a set of documents grouped by a shared domain, document type, or retrieval purpose.
- How it is used
- Partitions a knowledge base into retrieval targets for agentic query routing.
- How deep it goes
- Explains partitioning rationale and routing consequences, but does not detail collection implementation or indexing procedures.
- Examples
- Uses financial filings, technical documentation, OpenAI documentation, and live web search as distinct retrieval destinations.
- What you can do after
- Apply it via agentic routing to direct queries toward domain-appropriate document repositories.
Read how Build an Advanced RAG Application (From Scratch) explains collection →
Building Web APIs with ASP.NET Core
A document-database collection is a grouping of related documents that can contain records with flexible schemas.
- How it is used
- Organizes related board-game records and their associated information in a document-oriented database.
- How deep it goes
- Defines collections through storage-model comparison and embedded relationships, without detailing database commands or implementation code.
- Examples
- Uses users, roles, board games, and comments to contrast embedded documents with separately referenced records.
- What you can do after
- Evaluate whether related records fit an embedded collection design or require key-based references across documents.
Read how Building Web APIs with ASP.NET Core explains collection →
AI Agents and Applications
A collection is a Chroma container for documents, embeddings, metadata, and identifiers.
- How it is used
- Uses collections to ingest chunked content and retrieve semantically related documents for RAG-style questions.
- How deep it goes
- Explains creation, ingestion, embeddings, metadata, identifiers, querying, chunk granularity, and persistence, but not storage internals.
- Examples
- Demonstrates Paestum tourism chunks, Cornwall HTML chunks, granular and coarse collections, and multiple UK destination collections.
- What you can do after
- Build it from scratch with Chroma or LangChain, populate it with chunked documents, and run similarity queries against the stored content.
Microsoft Azure in Action
A MongoDB collection is a container that groups related documents for storage and querying.
- How it is used
- Organizes related documents inside a Cosmos DB database and supports scalable storage and querying.
- How deep it goes
- Explains creation, shard keys, partitions, throughput, and key-selection trade-offs without detailing MongoDB query syntax.
- Examples
- Uses an Azure CLI collection command and an Alpaca-Ma-Bags product catalog partitioned by category.
- What you can do after
- Operate collections via Azure CLI by selecting a partition key and configuring request-unit throughput.
Bootstrapping Microservices, Second Edition: With Docker, Kubernetes, GitHub Actions, and Terraform
A MongoDB collection is a group of related documents within a database.
- How it is used
- Uses collections to store application records and supply test data for a video-streaming microservice.
- 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 you can do after
- Operate collections by creating them, inserting records with Studio 3T, and accessing them through the MongoDB Node.js driver.
The Quick Python Book, Fourth Edition
A collection is a MongoDB container that groups documents within a database.
- How it is used
- Groups MongoDB documents for Python applications that need scalable, distributed storage and flexible schemas.
- How deep it goes
- Explains selection, lazy creation, CRUD operations, generated identifiers, and dropping collections, but not indexing or schema design.
- Examples
- Uses a PyMongo `docs` collection containing Jane’s profile, then demonstrates querying, updating, replacing, deleting, and dropping it.
- What you can do after
- Apply it via PyMongo to create, query, modify, replace, delete, and drop MongoDB collections and their documents.
Read how The Quick Python Book, Fourth Edition explains collection →
F# in Action: A Revised Edition of Get Programming with F#
A collection is a data structure or abstraction that groups multiple elements for traversal and processing.
- How it is used
- Processes application data through traversal, transformation, aggregation, and composable pipelines.
- How deep it goes
- Explains collection categories, pipeline patterns, aggregation inputs, and safe searches without detailing collection implementation internals.
- Examples
- Uses customer orders, customer debt, shopping baskets, optional values, searches, database results, web services, and event streams.
- What you can do after
- Apply F# collection modules, pipelines, folds, sequences, and safe option-returning operations to process data.
Read how F# in Action: A Revised Edition of Get Programming with F# explains collection →
Learn PowerShell in a Month of Lunches: Fourth Edition, Covers Windows, Linux, and macOS
A collection is a container that groups multiple values as a single data object.
- How it is used
- Groups related PowerShell values or objects so commands can inspect, test, or process them together.
- How deep it goes
- Defines collections, demonstrates storage and implicit property enumeration, then briefly applies membership tests and iteration.
- Examples
- Uses computer-name strings, process objects, text files, membership tests, and a number array from one through ten.
- What you can do after
- Apply it via PowerShell by creating collections, reading shared properties, testing membership, and iterating through items.
Learn PowerShell Scripting in a Month of Lunches, Second Edition: Write and organize scripts and tools
A collection is a group of objects treated as a single set of values for operations such as membership testing.
- How it is used
- Supports membership tests and iteration over arrays or other groups of objects in PowerShell scripts.
- How deep it goes
- Explains arrays, membership operators, enumeration, and naming practice through runnable examples, without covering collection internals.
- Examples
- Uses server lists, names read from a file, numeric ranges, and service objects.
- What you can do after
- Apply it via PowerShell to test membership and process each object in turn.
Data Pipelines with Apache Airflow, Second Edition
A collection is a named group of related objects with defined properties and vectorization settings in Weaviate.
- How it is used
- Configures the vector-database target that a recipe-ingestion pipeline checks before storing embedded content.
- How deep it goes
- Explains naming, properties, data types, vectorizers, existence checks, and schema replacement, but not Weaviate internals.
- Examples
- Uses a recipes collection with UUID identifiers, recipe text, content chunks, and a DockerOperator creation task.
- What you can do after
- Operate/configure a Weaviate collection for recipe ingestion with typed properties, vectorization settings, and repeatable creation checks.
Read how Data Pipelines with Apache Airflow, Second Edition explains collection →
Also covered in
- ASP.NET Core in Action, 3e
- Go in Action, Second Edition
- API Design Patterns
- LLMs in Production
- Python Workout, Second Edition
- GitHub Actions in Action: Continuous integration and delivery for DevOps
- .NET MAUI in Action
- Essential TypeScript 5, Third Edition
- Julia as a Second Language
- Learn Rust in a Month of Lunches
- Data-Oriented Programming: Reduce software complexity
- Build an AI Agent (From Scratch)
What to know first
- MapA map is an associative data structure that stores key-value associations and supports retrieving values by key.
- JSONJSON is a language-independent text-based data-interchange format that represents structured values using objects, arrays, strings, numbers, booleans, and null.
- arrayAn array is an ordered collection of elements organized in one or more dimensions and accessible by position or index.
- loopA loop is a programming-language control-flow construct that repeatedly executes a block of instructions according to an iteration rule or continuation condition.
Related concepts
- concurrent collectionincludes · A concurrent collection is a collection designed to support safe access or modification by multiple concurrent computations with defined concurrency behavior.
- unmodifiable collectionincludes · An unmodifiable collection is a collection whose exposed operations do not permit clients to change its elements or structure.
- Mapincludes · A map is an associative data structure that stores key-value associations and supports retrieving values by key.
- listincludes · A list is an ordered collection of elements arranged in a sequence.
Questions about collection
What is collection?
A collection is a container or abstraction that groups multiple elements for storage, access, traversal, or processing.
Which Manning books explain collection?
Kotlin in Action, 2E, MongoDB 8.0 in Action, Third Edition, 100 Java Mistakes and How to Avoid Them, AI-Powered Search, ScyllaDB in Action, Clojure: The Essential Reference, The Well-Grounded Rubyist, Fourth Edition, Build an Advanced RAG Application (From Scratch) and 9 more.
What should I know before learning collection?
Manning books that teach collection usually introduce Map, JSON, array and loop first.
What kinds of collection are there?
Kinds of collection include MutableCollection, asynchronous collection, concurrent collection, unmodifiable collection, Map and list.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.
















