- Reference >
- Enumeration Classes >
- MongoDB\Model\IndexInfo::isUnique()
MongoDB\Model\IndexInfo::isUnique()
On this page
Definition
-
MongoDB\Model\IndexInfo::isUnique Return whether the index is a unique index. This correlates with the
uniqueoption forMongoDB\Collection::createIndex().
Return Values
A boolean indicating whether the index is a unique index.
Examples
The output would then resemble:
bool(true)
See Also
MongoDB\Collection::createIndex()- listIndexes command reference in the MongoDB manual
- Unique Indexes in the MongoDB manual