can i display the number of items in a collection to a text field on my page? if so can someone please help me, it would be much appreciated.
my collection is called barbersdatabase and the text to display the number of items is called #text52
thank you to anyone who can help
You can also use the query count() function.
import wixData from 'wix-data'; $w.onReady(async function () { const results = await findNumber() $w("#text52").text = results.toString() });
function findNumber() { return wixData.query("barbersdatabase") .find() .then((res) => { return (res.totalCount); }) }