Problem with MongoDB-aggregate function

i didnt undestand from your answer how you put the aggregate query in msg.payload using the function node. Your function node doesnt even return any msg at all ... unless thats not a complete screenshot.

  1. Can you share the complete flow ?
  2. Can you put a complete msg Debug node after that function and copy/paste the result from debug window ?
  3. Can you paste a couple of data records from you mongodb collection ?