public function deleteMatchingTag($tag)
{
$this->collection->deleteDocuments(function (\Sokil\Mongo\Expression $e) use($tag) {
return $e->where(Cache::FIELD_NAME_TAGS, $tag);
});
return $this;
}
public function testDeleteMatchingTag() { $this->cache->setNeverExpired('php', 'PHP: Hypertext Processor', array('language', 'interpretable'))->setNeverExpired('c', 'C', array('language', 'compileable')); $this->assertEquals(2, count($this->cache)); $this->cache->deleteMatchingTag('compileable'); $this->assertEquals(1, count($this->cache)); $this->assertTrue($this->cache->has('php')); }