fix(membership): correct \$unwind option preserveNullAndEmpty → preserveNullAndEmptyArrays

MongoDB 7.0 rejects the invalid key with code 28811, causing 500 on
GET /organizations/{id}/members.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Vadym Samoilenko 2026-05-01 18:58:07 +01:00
parent 5f084f359f
commit 3a2bbc9ca0

View file

@ -109,7 +109,7 @@ async def list_org_members(
"as": "user_doc",
}
},
{"$unwind": {"path": "$user_doc", "preserveNullAndEmpty": False}},
{"$unwind": {"path": "$user_doc", "preserveNullAndEmptyArrays": False}},
{"$sort": {"created_at": 1}},
]
details = []