function getParametersFromTopology(conf, database) {
  // in older versions of 3.x the host/port
  // lived directly on the topology
  let { host, port } = conf

  // servers is an array but we will always pull the first for consistency
  if (conf?.s?.options?.servers?.length) {
    ;[{ host, port }] = conf.s.options.servers
  }

  // hosts is an array but we will always pull the first for consistency
  if (conf?.s?.options?.hosts?.length) {
    ;[{ host, port }] = conf.s.options.hosts
  }

  return new DatastoreParameters({
    host,
    port_path_or_id: port,
    database_name: database
  })
}
Extracts the database parameters from the relevant
topology configuration

@param {object} conf topology configuration
@param {string} database name of database
@returns {object} db params