public function deleteAccessRule($publicKey, $accessId)
{
try {
$result = $this->getAclCollection()->updateOne(['publicKey' => $publicKey], ['$pull' => ['acl' => ['id' => new MongoId($accessId)]]]);
return (bool) $result->getMatchedCount();
} catch (MongoException $e) {
throw new DatabaseException('Could not delete rule from database', 500, $e);
}
}