ensureTTLIndex() 공개 메소드

Create TTL index
public ensureTTLIndex ( array $key, integer $seconds ) : Collection
$key array key must be date to use TTL
$seconds integer
리턴 Collection
예제 #1
0
 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']);
 }