function queryParser(params) {
  params = JSON.parse(params)
  const { collection, operation } = parsePath(params.path, params.method)

  // the substance of the query may be in querystring or in body.
  let queryParam = {}
  if (isNotEmpty(params.querystring)) {
    queryParam = params.querystring
  }
  // let body or bulkBody override querystring, as some requests have both
  if (isNotEmpty(params.body)) {
    queryParam = params.body
  } else if (Array.isArray(params.bulkBody) && params.bulkBody.length) {
    queryParam = params.bulkBody
  }
  // The helper interface provides a simpler API:

  const query = JSON.stringify(queryParam)

  return {
    collection,
    operation,
    query
  }
}
Parses the parameters sent to elasticsearch for collection,
method, and query

@param {object} params Query object received by the datashim.
Required properties: path {string}, method {string}.
Optional properties: querystring {string}, body {object}, and
bulkBody {object}
@returns {object} consisting of collection {string}, operation {string},
and query {string}