定义
MongoDB\Model\IndexInfo::isTtl()Return whether the index is a TTL index. This correlates with the
expireAfterSecondsoption forMongoDB\Collection::createIndex().function isTtl(): boolean
Return Values
指示索引是否为 TTL 索引的布尔值。
示例
$info = new IndexInfo([ 'expireAfterSeconds' => 100, ]); var_dump($info->isTtl());
而输出将类似如下所示:
bool(true)
另请参阅
listIndexes command reference in the MongoDB manual
MongoDB 手册中的TTL 索引