next MongoDB api route returns []
Does anyone know why im not geting my data to show up I've checked everything like 3 times and can't understand why im geting an empty array
even when i change it to.find({}) get same result
4 Replies
find returns all values that match the query
the [] just means that no tool was found
i get the same result even when I do find({})
it should return all data in the data table but I just get the same result
got it to work with this export async function GET() {
await connect();
const tools = await ToolData.find({});
return NextResponse.json(tools);
}