mongodb\QueryBuilder buildSimpleCondition()

buildSimpleCondition() public method Creates an Mongo condition like {$operator:{field:value}}. public string buildSimpleCondition ( $operator, $operands )$operator string The operator to use. Besides regular MongoDB operators, aliases like >, <=, and so on, can be used here. $operands array The first operand is the column name. The second operand is a single value that column value should be compared with. return string The generated Mongo condition. throws yii\base\InvalidPa

mongodb\QueryBuilder buildSelectFields()

buildSelectFields() public method Normalizes fields list for the MongoDB select composition. public array buildSelectFields ( $fields )$fields array|string Raw fields. return array Normalized select fields.

mongodb\QueryBuilder buildRegexCondition()

buildRegexCondition() public method Creates a Mongo regular expression condition. public array buildRegexCondition ( $operator, $operands )$operator string The operator to use $operands array The first operand is the column name. The second operand is a single value that column value should be compared with. return array The generated Mongo condition. throws yii\base\InvalidParamException if wrong number of operands have been given.

mongodb\QueryBuilder buildOrCondition()

buildOrCondition() public method Connects two or more conditions with the OR operator. public array buildOrCondition ( $operator, $operands )$operator string The operator to use for connecting the given operands $operands array The Mongo conditions to connect. return array The generated Mongo condition.

mongodb\QueryBuilder buildNotCondition()

buildNotCondition() public method Composes NOT condition. public array buildNotCondition ( $operator, $operands )$operator string The operator to use for connecting the given operands $operands array The Mongo conditions to connect. return array The generated Mongo condition. throws yii\base\InvalidParamException if wrong number of operands have been given.

mongodb\QueryBuilder buildLikeCondition()

buildLikeCondition() public method Creates a Mongo condition, which emulates the LIKE operator. public array buildLikeCondition ( $operator, $operands )$operator string The operator to use $operands array The first operand is the column name. The second operand is a single value that column value should be compared with. return array The generated Mongo condition. throws yii\base\InvalidParamException if wrong number of operands have been given.

mongodb\QueryBuilder buildInCondition()

buildInCondition() public method Creates an Mongo condition with the IN operator. public array buildInCondition ( $operator, $operands )$operator string The operator to use (e.g. IN or NOT IN) $operands array The first operand is the column name. If it is an array a composite IN condition will be generated. The second operand is an array of values that column value should be among. return array The generated Mongo condition. throws yii\base\InvalidParamException if wrong number of

mongodb\QueryBuilder buildHashCondition()

buildHashCondition() public method Creates a condition based on column-value pairs. public array buildHashCondition ( $condition )$condition array The condition specification. return array The generated Mongo condition.

mongodb\QueryBuilder buildCondition()

buildCondition() public method Parses the condition specification and generates the corresponding Mongo condition. public array buildCondition ( $condition )$condition array The condition specification. Please refer to yii\mongodb\Query::where() on how to specify a condition. return array The generated Mongo condition throws yii\base\InvalidParamException if the condition is in bad format

mongodb\QueryBuilder buildBetweenCondition()

buildBetweenCondition() public method Creates an Mongo condition, which emulates the BETWEEN operator. public array buildBetweenCondition ( $operator, $operands )$operator string The operator to use $operands array The first operand is the column name. The second and third operands describe the interval that column value should be in. return array The generated Mongo condition. throws yii\base\InvalidParamException if wrong number of operands have been given.