docs: function _mergeQueryJSONs(j1, j2) {
      // if same, return one
      if (dataUtils.deepEquals(j1, j2)) {
          return [j1];
      }
      var isJ1JSON = dataUtils.isJSON(j1);
      var isJ2JSON = dataUtils.isJSON(j2);
      // return as it is, if none is a JSON
      if (!isJ1JSON && !isJ2JSON) {
          return [j1, j2];
      }
  
      // if either is not a JSON, return both,
      // but keep the JSON as the first (merged)
      else if (isJ1JSON && !isJ2JSON) {
          return [j1, j2];
      }
      else if (!isJ1JSON && isJ2JSON) {
          return [j2, j1];
      }
  
      var merged = {};
      var residue = {};
  
      var j1Keys = Object.keys(j1).sort();
      var j2Keys = Object.keys(j2).sort();
  
      var i, j, key, mergedChildren;
      // merge j1 properties
      for (i = 0; i < j1Keys.length; ++i) {
          key = j1Keys[i];
          // add properties unique to j1
          if (!j2.hasOwnProperty(key) || dataUtils.deepEquals(j1[key], j2[key])) {
              merged[key] = j1[key];
          }
          // merge keys present in both the JSONs
          else {
              // combine $in operators for the same field
              if (j1[key].$in && j2[key].$in) {
                  for (j = 0; j < j2[key].$in.length; ++j) {
                      if (j1[key].$in.indexOf(j2[key].$in[j]) < 0) {
                          j1[key].$in.push(j2[key].$in[j]);
                      }
                  }
                  delete j2[key].$in;
              }
  
              // merge remaining operators
              mergedChildren = _mergeQueryJSONs(j1[key], j2[key]);
              if (mergedChildren.length > 0) merged[key] = mergedChildren[0];
              if (mergedChildren.length > 1) residue[key] = mergedChildren[1];
          }
      }
      // add properties unique to j2
      for (i = 0; i < j2Keys.length; ++i) {
          key = j2Keys[i];
          if (!j1.hasOwnProperty(key)) {
              merged[key] = j2[key];
          }
      }
  
      var result = [];
      if (Object.keys(merged).length) result.push(merged);
      if (Object.keys(residue).length) result.push(residue);
      return result;
  }