export default defineEventHandler(async () => { const storesColl = db.collection('stores'); const cursor = storesColl.aggregate([ { $lookup: { from: "users", localField: "ownerId", foreignField: "_id", as: "owner", }, }, { $unwind: "$owner", }, ]) return await cursor.toArray() });