src/Query/Parser.php
public static function where($field, $operator, $value, $logical)
    {
        if (gettype($field)=="array") {
            throw new ClusterpointException("\"->where()\" function: passed field selector is not in valid format.", 9002);
        }
        if ($operator===null) {
            return "{$logical} {$field} ";
        } elseif ($value===null) {
            $value = $operator;
            $operator = '==';
        }
        if ($field instanceof Key) {
            $field =  self::field("{$field}");
        }
        if (!($value instanceof Raw)) {
        	if (is_string($value)){
				$value = '"'.Client::escape($value).'"';
			}
			else {
				$value =  json_encode($value);
			}
        }
        return "{$logical} {$field}{$operator}{$value} ";
    }
public static function where($field, $operator, $value, $logical)
    {
        if (gettype($field)=="array") {
            throw new ClusterpointException("\"->where()\" function: passed field selector is not in valid format.", 9002);
        }
        if ($operator===null) {
            return "{$logical} {$field} ";
        } elseif ($value===null) {
            $value = $operator;
            $operator = '==';
        }
        if ($field instanceof Key) {
            $field =  self::field("{$field}");
        }
        if (!($value instanceof Raw)) {
        	if (is_string($value)){
				$value = '"'.Client::escape($value).'"';
			}
			else {
				$value =  json_encode($value);
			}
        }
        return "{$logical} {$field}{$operator}{$value} ";
    }
Pass back WHERE clause string to append the scope.

@param  string  $field
@param  string  $operator
@param  mixed   $value
@param  string  $logical
@return string