Hmmm … I tried adding an empty $match stage before the $unwind
{ $match: {} }
In PHP, that becomes this (took me a moment to figure it out
)
['$match' => [null => null]]
But the behavior is the same. I guess the behavior for unwinding all fields from all documents at once has changed and I’ll need to implement the solution suggested by @Andreas_Braun above.