Using an $out collection to avoid memory issues in calculate_characteristic_ngrams(level,field,n)