function paginate(
		$pos=0,$size=10,$filter=NULL,array $options=NULL,$ttl=0,$bounce=TRUE) {
		$total=$this->count($filter,$options,$ttl);
		$count=ceil($total/$size);
		if ($bounce)
			$pos=max(0,min($pos,$count-1));
		return [
			'subset'=>($bounce || $pos<$count)?$this->find($filter,
				array_merge(
					$options?:[],
					['limit'=>$size,'offset'=>$pos*$size]
				),
				$ttl
			):[],
			'total'=>$total,
			'limit'=>$size,
			'count'=>$count,
			'pos'=>$bounce?($pos<$count?$pos:0):$pos
		];
	}