Polarcraft/web/server/api/team/unaffiliated.js

8 lines
236 B
JavaScript

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