- Reference >
- MongoDB\Collection Class >
- MongoDB\Collection::getNamespace()
MongoDB\Collection::getNamespace()
On this page
Definition
-
MongoDB\Collection::getNamespace
Returns the namespace of the collection. A namespace is the canonical name of an index or collection in MongoDB.
Return Values
The namespace of this collection as a string.
Example
The following returns the namespace of the zips
collection in the test
database.
The output would then resemble: