79271124

Date: 2024-12-11 09:22:38
Score: 1.5
Natty:
Report link

Thank you my friend, the problem was in the double quotes.

array(
        '$project' => array(
        '_id' => 0, 
        'data' => ['$arrayElemAt'=> ['$data', 0]],
         )
    ),
     array(
        '$replaceRoot' => array(
             'newRoot'=> '$data',        
         )
    ),

doing this fixed it

Reasons:
  • Blacklisted phrase (0.5): Thank you
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Yusuf Damista