code: def cursor_to_lines(self, cursor, format_func=None):
          
          for doc in cursor:
              yield from self.doc_to_lines(doc, format_func)
docs: Take a cursor that returns a list of docs and returns a
          generator yield each line of each doc a line at a time.
          :param cursor: A mongod cursor yielding docs (dictonaries)
          :param format_func: A customisable format function
          :return: a generator yielding a line at a time