transformQueryInputToParse = (constraints, className, parseClasses) => {
  if (!constraints || typeof constraints !== 'object') {
    return;
  }

  Object.keys(constraints).forEach(fieldName => {
    const fieldValue = constraints[fieldName];

    if (parseQueryMap[fieldName]) {
      delete constraints[fieldName];
      fieldName = parseQueryMap[fieldName];
      constraints[fieldName] = fieldValue;
      fieldValue.forEach(fieldValueItem => {
        transformQueryInputToParse(fieldValueItem, className, parseClasses);
      });
      return;
    } else {
      transformQueryConstraintInputToParse(
        fieldValue,
        fieldName,
        className,
        constraints,
        parseClasses
      );
    }
  });
}
If we have a key-value pair, we need to change the way the constraint is structured.

Example:
  From:
  {
    "someField": {
      "lessThan": {
        "key":"foo.bar",
        "value": 100
      },
      "greaterThan": {
        "key":"foo.bar",
        "value": 10
      }
    }
  }

  To:
  {
    "someField.foo.bar": {
      "$lt": 100,
      "$gt": 10
     }
  }