[SERVER-1947] can't push and set in one operation Created: 14/Oct/10 Updated: 06/Dec/22 Resolved: 29/Jun/19 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Write Ops |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Minor - P4 |
| Reporter: | Dwight Merriman | Assignee: | Backlog - Query Team (Inactive) |
| Resolution: | Won't Do | Votes: | 24 |
| Labels: | positional-operator | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Assigned Teams: |
Query
|
||||||||||||
| Participants: | |||||||||||||
| Description |
|
> t.find() ] } > u , , } |
| Comments |
| Comment by Asya Kamsky [ 29/Jun/19 ] | ||||||||||
|
You can see some examples here. This can be done by setting the array to its new value using various aggregation array expressions. Example:
There are several ways to do this in aggregation. | ||||||||||
| Comment by Christopher Price [ 15/Jul/15 ] | ||||||||||
|
Would love to be able to do something like this:
We currently have to do this in two statements. | ||||||||||
| Comment by Dwight Merriman [ 17/Sep/12 ] | ||||||||||
|
slightly simpler example: > t.find() , 999 ], "versionsCount" : 1 } , } |