liveBook · Manning

Namespace

As explained in MongoDB 8.0 in Action, Third Edition

A namespace is MongoDB's unique identifier for a collection formed by combining its database name and collection name with a dot.

A namespace uniquely identifies a MongoDB collection by joining its database name and collection name with a dot. MongoDB limits namespaces to 255 bytes. section 2.6.3

Use collection inspection commands to locate or display a namespace:

  • Inspect collection options, permissions, and indexes with db.getCollectionInfos(). section 2.6.3

Example namespace

For the sample_mflix database and embedded_movies collection, the namespace is sample_mflix.embedded_movies. section 2.6.3

How MongoDB 8.0 in Action, Third Edition covers it

How deep it goes
Defines the database-qualified naming format, demonstrates its output, and states the 255-byte limit.
Examples
Uses sample_mflix.embedded_movies and db.getCollection("embedded_movies") as concrete namespace examples.
What it assumes
Assumes access to a MongoDB deployment and basic use of mongosh databases and collections.
What you can do after
Operate mongosh to list collections, inspect metadata, and display a collection's fully qualified namespace.
How it connects
Connects namespaces with databases, collections, collection metadata, permissions, and indexes.

Also explained in

Compare how 20 books explain namespace →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of MongoDB 8.0 in Action, Third Edition. The section links point to the parts of the book it draws on.