티스토리 뷰
반응형
The following modifiers are available for use in update operations; e.g. in db.collection.update()
and db.collection.findAndModify()
.
Specify the operator expression in a document of the form:
{
<operator1>: { <field1>: <value1>, ... },
<operator2>: { <field2>: <value2>, ... },
...
}
NOTE
For details on specific operator, including syntax and examples, click on the specific operator to go to its reference page.
Update Operators
Fields
Name | Description |
---|---|
$inc | Increments the value of the field by the specified amount. |
$mul | Multiplies the value of the field by the specified amount. |
$rename | Renames a field. |
$setOnInsert | Sets the value of a field if an update results in an insert of a document. Has no effect on update operations that modify existing documents. |
$set | Sets the value of a field in a document. |
$unset | Removes the specified field from a document. |
$min | Only updates the field if the specified value is less than the existing field value. |
$max | Only updates the field if the specified value is greater than the existing field value. |
$currentDate | Sets the value of a field to current date, either as a Date or a Timestamp. |
Array
Operators
Name | Description |
---|---|
$ | Acts as a placeholder to update the first element that matches the query condition in an update. |
$addToSet | Adds elements to an array only if they do not already exist in the set. |
$pop | Removes the first or last item of an array. |
$pullAll | Removes all matching values from an array. |
$pull | Removes all array elements that match a specified query. |
$pushAll | Deprecated. Adds several items to an array. |
$push | Adds an item to an array. |
Modifiers
Name | Description |
---|---|
$each | Modifies the $push and $addToSet operators to append multiple items for array updates. |
$slice | Modifies the $push operator to limit the size of updated arrays. |
$sort | Modifies the $push operator to reorder documents stored in an array. |
$position | Modifies the $push operator to specify the position in the array to add elements. |
Bitwise
Name | Description |
---|---|
$bit | Performs bitwise AND , OR , and XOR updates of integer values. |
Isolation
Name | Description |
---|---|
$isolated | Modifies the behavior of a write operation to increase the isolation of the operation. |
반응형
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- node.js
- Pixel Pals
- 루미큐브 종류
- 증권정보포털
- weka
- 고체 향수
- 별잉 빛나는 밤
- 르세라핌
- 배당급
- JMW 헤어드라이기기
- 파나소닉 비데 DL-EH10KWS
- 오미크론
- yugabyteDB
- 로니카 BCS
- VARIDESK
- 톡토기
- Life Chair
- 홈 오피스
- 별이 빚나는 밤
- 브리다 정수기
- 화분벌레
- 유가바이트디비
- Sybase IQ
- GKRS
- 카카오 에드
- 빈센트 반 고흐
- 남설 팔찌
- 코라나 19
- 솔리드 쿨론
- 매직 트랙패드2
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
글 보관함