static getQueryCondition(req) {
    const body = req.body || {};
    const hasWhere = typeof body.where !== 'undefined';
    const hasChannels = typeof body.channels !== 'undefined';

    let where;
    if (hasWhere && hasChannels) {
      throw new Parse.Error(
        Parse.Error.PUSH_MISCONFIGURED,
        'Channels and query can not be set at the same time.'
      );
    } else if (hasWhere) {
      where = body.where;
    } else if (hasChannels) {
      where = {
        channels: {
          $in: body.channels,
        },
      };
    } else {
      throw new Parse.Error(
        Parse.Error.PUSH_MISCONFIGURED,
        'Sending a push requires either "channels" or a "where" query.'
      );
    }
    return where;
  }
Get query condition from the request body.
@param {Object} req A request object
@returns {Object} The query condition, the where field in a query api call