code: function generateQuery(searchParams, cb) {
    if (searchParams.query ) {
      searchSubmissions.queryBuilder(searchParams.query, cb);
    } else {
      return cb(undefined, buildQuery(searchParams));
    }
  }
docs: generateQuery - Generating either a basic query or advanced search query
  
  @param  {object} searchParams          params to search submissions by
  @param  {array} searchParams.formId   Array of form IDs to search for
  @param  {array} searchParams.subid   Array of submission IDs to search for
  @param  {string} searchParams.filter A string value to filter the submissions by metadata
  @param  {string} searchParams.query  An advanced submission query object
  @param  {array} searchParams.appId   Array of Project IDs to search for
  @param  {function} cb
  @return {object} Generated mongo query