Polarcraft/web/server/api/team/unaffiliated.js
2023-05-09 13:57:01 +02:00

8 lines
241 B
JavaScript

export default defineEventHandler(async (event) => {
const usersColl = db.collection('users')
const cursor = usersColl.find({ team: { $exists: false } })
const unaffiliatedUsers = await cursor.toArray()
return unaffiliatedUsers
});