Query for documents in a mongodb collection where the last element in a nested array has a certain value
I am trying to find a way to query a mongodb collection: all documents whose state value of 'running' is also the latest entry inside the 'history' array should be returned. I was able to do this in C# with…