wouldn't you have to set @current_chunk to the chunk returned by this query?
In that case you could do:

    unless @current_chunk && @current_chunk['n'] == n
      @current_chunk = @chunks.find_one({ 'files_id' => @files_id, 'n' => n })
    end
    @current_chunk