由於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