Update operators
HCL OneDB™ supports a subset the MongoDB update operators.
You can use update
operators to modify or add data in your database. For example, in
the mongo shell, to change the username to atlas
in the document with the _id of 101 in the users collection, you can
use the $set operator: db.users.update({"_id":101},{"$set":{"username":"atlas"}})
.
- Array update operators
Table 1. Array update operators MongoDB command JSON collections Relational tables Details $ No No $addToSet Yes No Supported for primitive values only. The operator is not supported on arrays and objects. $pop Yes No $pullAll Yes No Supported for primitive values only. The operator is not supported on arrays and objects. $pull Yes No Supported for primitive values only. The operator is not supported on arrays and objects. $pushAll Yes No $push Yes No - Array update operators modifiers
Table 2. Array update modifiers MongoDB command JSON collections Relational tables Details $each Yes No $slice Yes No $sort Yes No $position Yes No - Bitwise update operators
Table 3. Bitwise update operators MongoDB command JSON collections Relational tables Details $bit Yes No - Field update operators
Table 4. Field update operators MongoDB command JSON collections Relational tables Details $currentDate Yes Yes $inc Yes Yes $max Yes Yes $min Yes Yes $mul Yes Yes $rename Yes No $setOnInsert Yes No $set Yes Yes $unset Yes Yes - Isolation update operators
- The isolation update operators are not supported.
For more information about the MongoDB features, see http://docs.mongodb.org/manual/reference/.