|
MSG_STATE
|
STATE
|
|
READY
|
0
|
|
WAITING
|
1
|
|
RETAINED OR PROCESSED
|
2
|
|
EXPIRED
|
3
|
|
IN MEMORY
|
4
|
|
SPILLED
|
7
|
|
DEFERRED
|
8
|
|
DEFERRED SPILLED
|
9
|
|
BUFFERED EXPIRED
|
10
|
Input Collection - [ { 'k' : 'Troubleshooting' , 'hour' : '2024-10-10T16' , 'v' : [ 'WebPage, Login' ] }, { 'k' : 'TroubleshootingMe' , 'hour' : '2024-10-07T01' , 'v' : [ 'Accounts, etc' ] } ] Expected Output - [ { 'hour' : '2024-10-10T16' , 'Troubleshooting' : [ 'WebPage, Login' ] }, { 'hour' : '2024-10-07T01' , 'TroubleshootingMe' : [ 'Accounts, etc' ] } ] Above Can be achieved by $replaceRoot / $replaceWith as follows - { $replaceWith : { $mergeObjects : [ { hour : "$hour" }, { "$arrayToObject" : [ [ { k : "$k" , v : "$v" } ] ] } ] } } or { $replaceRoo...
Comments
Post a Comment