docs: def returner(ret):
      '''
      Return data to a mongodb server
      '''
      conn, mdb = _get_conn(ret)
  
      if isinstance(ret['return'], dict):
          back = _remove_dots(ret['return'])
      else:
          back = ret['return']
  
      if isinstance(ret, dict):
          full_ret = _remove_dots(ret)
      else:
          full_ret = ret
  
      log.debug(back)
      sdata = {'minion': ret['id'], 'jid': ret['jid'], 'return': back, 'fun': ret['fun'], 'full_ret': full_ret}
      if 'out' in ret:
          sdata['out'] = ret['out']
  
      # save returns in the saltReturns collection in the json format:
      # { 'minion': <minion_name>, 'jid': <job_id>, 'return': <return info with dots removed>,
      #   'fun': <function>, 'full_ret': <unformatted return with dots removed>}
      #
      # again we run into the issue with deprecated code from previous versions
  
      if PYMONGO_VERSION > _LooseVersion('2.3'):
          #using .copy() to ensure that the original data is not changed, raising issue with pymongo team
          mdb.saltReturns.insert_one(sdata.copy())
      else:
          mdb.saltReturns.insert(sdata.copy())