How can i sort based on values in a array of docs. Below is the History Array which is part of a doc. There is 2 cases i would like to use, how would i use the sort or
a) Sort based on the DateTime Value
b) Sort based on the DateTime where Status is Active and Action Refresh
Also what would an ideal index look like
"History": [
{
"Action": "Initial",
"DateTime": "2020-04-21 16:11:38",
"Status": "Active"
},
{
"DateTime": "2020-04-23 08:05:06",
"Action": "Refresh",
"Status": "Active"
},
{
"DateTime": "2020-04-23 08:10:05",
"Action": "NoChange",
"Status": "Active"
}
]