get nkeyrec from array length