Create TTL index
public ensureTTLIndex ( array $key, integer $seconds ) : |
||
$key | array | key must be date to use TTL |
$seconds | integer | |
리턴 |
public function testEnsureTTLIndex() { $this->collection->ensureTTLIndex(array('ttlAsc' => 1, 'ttlDesc' => -1), 12000); $indexes = $this->collection->getIndexes(); $this->assertEquals(array('ttlAsc' => 1, 'ttlDesc' => -1), $indexes[1]['key']); $this->assertArrayHasKey('expireAfterSeconds', $indexes[1]); $this->assertEquals(12000, $indexes[1]['expireAfterSeconds']); }