how od i send only the names of the documents in the collection through the endpoint?
import { db } from '../../lib/firebase';
export default async function handler(req, res) {
const user = await db
.collection('readings')
.get();
if (!user.exists) {
return res.status(404).json({});
}
return res.status(404).toArray(user.id);
}
I need to call the endpoint and then have the information sent to the frontend. The collection of readings has a bunch of documents with all the account id's
how do I retrieve only the id's from the collection?