+2012-12-14 Anton Adamansky. <adamansky@gmail.com>
+ * Added `$addToSet` and `$pull` operations.
+ - Release 1.0.26
+
2012-12-04 Anton Adamansky. <adamansky@gmail.com>
* Allows multiple matching conditions for single query field. Eg: {'age' : {'$lt' : '60', '$gt' : '30'}}
- Release 1.0.25
- {'name' : {'$icase' : {'$in' : ['tHéâtre - театр', 'heLLo WorlD']}}}
For case insensitive matching you can create special type of string index.
- Queries can be used to update records:
- `$set` Field set operation.
- - {some fields for selection, '$set' : {'field1' : {obj}, ..., 'field1' : {obj}}}
- `$inc` Increment operation. Only number types are supported.
- - {some fields for selection, '$inc' : {'field1' : number, ..., 'field1' : {number}}
- `$dropall` In-place record removal operation.
- - {some fields for selection, '$dropall' : true}
+ - Queries can be used to update records:
+
+ $set Field set operation.
+ - {.., '$set' : {'field1' : val1, 'fieldN' : valN}}
+ $inc Increment operation. Only number types are supported.
+ - {.., '$inc' : {'field1' : number, ..., 'field1' : number}
+ $dropall In-place record removal operation.
+ - {.., '$dropall' : true}
+ $addToSet Atomically adds value to the array only if its not in the array already.
+ If containing array is missing it will be created.
+ - {.., '$addToSet' : {'json.field.path' : val1, 'json.field.pathN' : valN, ...}}
+ $pull - Atomically removes all occurrences of value from field, if field is an array.
+ - {.., '$pull' : {'json.field.path' : val1, 'json.field.pathN' : valN, ...}}
NOTE: It is better to execute update queries with `$onlycount=true` hint flag
or use the special `update()` method to avoid unnecessarily rows fetching.
- {some fields for selection, '$inc' : {'field1' : number, ..., 'field1' : {number}}
* `$dropall` In-place record removal operation.
- {some fields for selection, '$dropall' : true}
+ * `$addToSet` Atomically adds value to the array only if its not in the array already.
+ If containing array is missing it will be created.
+ - {.., '$addToSet' : {'json.field.path' : val1, 'json.field.pathN' : valN, ...}}
+ * `$pull` Atomically removes all occurrences of value from field, if field is an array.
+ - {.., '$pull' : {'json.field.path' : val1, 'json.field.pathN' : valN, ...}}
Call variations of update():
* - {'name' : {'$icase' : {'$in' : ['tHéâtre - театр', 'heLLo WorlD']}}}
* For case insensitive matching you can create special type of string index.
*
- * - Queries can be used to update records
- *
- * `$set` Field set operation.
- * - {some fields for selection, '$set' : {'field1' : {obj}, ..., 'field1' : {obj}}}
- * `$inc` Increment operation. Only number types are supported.
- * - {some fields for selection, '$inc' : {'field1' : number, ..., 'field1' : {number}}
- * `$dropall` In-place record removal operation.
- * - {some fields for selection, '$dropall' : true}
+ * - Queries can be used to update records:
+ *
+ * $set Field set operation.
+ * - {.., '$set' : {'field1' : val1, 'fieldN' : valN}}
+ * $inc Increment operation. Only number types are supported.
+ * - {.., '$inc' : {'field1' : number, ..., 'field1' : number}
+ * $dropall In-place record removal operation.
+ * - {.., '$dropall' : true}
+ * $addToSet Atomically adds value to the array only if its not in the array already.
+ * If containing array is missing it will be created.
+ * - {.., '$addToSet' : {'json.field.path' : val1, 'json.field.pathN' : valN, ...}}
+ * $pull Atomically removes all occurrences of value from field, if field is an array.
+ * - {.., '$pull' : {'json.field.path' : val1, 'json.field.pathN' : valN, ...}}
*
* NOTE: It is better to execute update queries with `$onlycount=true` hint flag
* or use the special `update()` method to avoid unnecessarily data fetching.
* - {'name' : {'$icase' : {'$in' : ['théâtre - театр', 'hello world']}}}
* For case insensitive matching you can create special index of type: `JBIDXISTR`
*
- * - Queries can be used to update records
+ * - Queries can be used to update records:
*
- * `$set` Field set operation.
- * - {some fields for selection, '$set' : {'field1' : {obj}, ..., 'field1' : {obj}}}
- * `$inc` Increment operation. Only number types are supported.
- * - {some fields for selection, '$inc' : {'field1' : number, ..., 'field1' : {number}}
- * `$dropall` In-place record removal operation.
- * - {some fields for selection, '$dropall' : true}
+ * $set Field set operation.
+ * - {.., '$set' : {'field1' : val1, 'fieldN' : valN}}
+ * $inc Increment operation. Only number types are supported.
+ * - {.., '$inc' : {'field1' : number, ..., 'field1' : number}
+ * $dropall In-place record removal operation.
+ * - {.., '$dropall' : true}
+ * $addToSet Atomically adds value to the array only if its not in the array already.
+ * If containing array is missing it will be created.
+ * - {.., '$addToSet' : {'json.field.path' : val1, 'json.field.pathN' : valN, ...}}
+ * $pull Atomically removes all occurrences of value from field, if field is an array.
+ * - {.., '$pull' : {'json.field.path' : val1, 'json.field.pathN' : valN, ...}}
*
*
* NOTE: It is better to execute update queries with `JBQRYCOUNT`
EJCONDSET = 1 << 10, /**> $set Set field update operation */
EJCONDINC = 1 << 11, /**> $inc Inc field update operation */
- EJCONDADDSET = 1 << 12, /**> $addToSet Adds value to the array only if its not in the array already */
+ EJCONDADDSET = 1 << 12, /**> $addToSet Adds value to the array only if its not in the array already. */
EJCONDPULL = 1 << 13 /**> $pull Removes all occurrences of value from field, if field is an array */
};