I'm sorry if this has been asked but I have found many questions about ordering by field contents. I would like to order by field names. I have tried orderBy, orderByChild and startAt - none of which worked.
My collection looks like this:

I would like my data to always start with 'All', after that the order does not matter. Here's how I fetch the data:
const fetchProjects = async() => {
const catRef = doc(db, 'Portfolio', 'Category')
const catSnap = await getDoc(catRef)
if(catSnap.exists()) {
setCategory(catSnap.data())
}
}
And then I create buttons to select certain fields of data as below:
const sortButton = (key) => {
if(filter === key) {
return (<div key={key}>
<button className='prt-act-btn' >{key}</button>
</div>)
} else {
return ( <div key={key}>
<button className='prt-btn' onClick={() => setFilter(`${key}`)}>{key}</button>
</div> )}
}
if(loading || fetching) {
return <p>loading...</p>
}
return (
<>
<p className="pageHeader"> <FaFileArchive/> Portfolio</p>
<div className='center'>
{Object.keys(category).map((key) => (
sortButton(key)
))}
</div>
}
So essentially the problem is that my buttons are randomized in order after each reload and I would like to start with 'All' and then list the other categories like 'API', 'Blockchain', 'Database' etc.
Thank you for any help!