// Next.js API route support: https://nextjs.org/docs/api-routes/introduction
import client from "@/lib/mongodb";
import type {NextApiRequest, NextApiResponse} from "next";

const db = client.db(process.env.MONGODB_DB);

type Data = {
	name: string;
};

export default async function handler(req: NextApiRequest, res: NextApiResponse<Data>) {
	await db.collection("users").updateMany({}, {$set: {entities: []}});

	res.status(200).json({name: "John Doe"});
}
