Having data like below.
{
"summary": "testing api1",
"UpdatedDate": {
"$date": "2018-12-30T00:00:00.000Z"
},
"status": "draft"
},
{
"summary": "testing api2",
"UpdatedDate": {
"$date": "2018-12-30T00:00:00.000Z"
},
"status": "published"
},
{
"summary": "testing api3",
"UpdatedDate": {
"$date": "2018-12-30T00:00:00.000Z"
},
"status": "delete"
}
I want to sort based "status" For ex: If I have given sort by status "published" then I need data like below
{
"summary": "testing api2",
"UpdatedDate": {
"$date": "2018-12-31T00:00:00.000Z"
},
"status": "published"
},
{
"summary": "testing api1",
"UpdatedDate": {
"$date": "2018-12-30T00:00:00.000Z"
},
"status": "draft"
},
{
"summary": "testing api3",
"UpdatedDate": {
"$date": "2019-01-01T00:00:00.000Z"
},
"status": "delete"
}
It's possible in mongodb? or anything available similar like this?