code: def _generate_recommendation(self,
                                   query_analysis,
                                   db_name,
                                   collection_name):
          
          index_rec = '{'
          for query_field in query_analysis['analyzedFields']:
              if query_field['fieldType'] is EQUIV_TYPE:
                  if len(index_rec) is not 1:
                      index_rec += ', '
                  index_rec += '"' + query_field['fieldName'] + '": 1'
          for query_field in query_analysis['analyzedFields']:
              if query_field['fieldType'] is SORT_TYPE:
                  if len(index_rec) is not 1:
                      index_rec += ', '
                  index_rec += '"' + query_field['fieldName'] + '": 1'
          for query_field in query_analysis['analyzedFields']:
              if query_field['fieldType'] is RANGE_TYPE:
                  if len(index_rec) is not 1:
                      index_rec += ', '
                  index_rec += '"' + query_field['fieldName'] + '": 1'
          index_rec += '}'
  
          # RECOMMENDATION
          return OrderedDict([('index',index_rec),
                              ('shellCommand', self.generate_shell_command(collection_name, index_rec))])
docs: Generates an ideal query recommendation