由于MongoDB 2.2可以将“Expire Data from Collections Using a TTL”作为特殊索引类型实现。 最新版本的Doctrine ORM支持这个Index Option。不幸的是,我一直无法找到如何使用doctrine annotations/config文件正确设置此索引。 这是我如何努力做到这一点,我希望有人能帮助我正确设置它: <?php
use D
至于我自己看着办,这似乎是成立的Memcached并设置TTL和命名空间的方式,但他们在高速缓存中没有效果。密钥没有用命名空间作为前缀,并且过期是无限的。 $MemcachedOptions = new \Zend\Cache\Storage\Adapter\MemcachedOptions();
$MemcachedResourceManager = new \Zend\Cache\S
class Event
include Mongoid::Document
field :status, type: Integer
index({ status: 1 }, { expire_after_seconds: 3600 })
end
我知道MongoDB和Mongoid的TTL选项。 https://github.com/mongoid/mongo