I wrote the following code.
const salons = query(collection(db, "user"), orderBy('', "desc"), limit(5))
const querySnapshot = await getDocs(salons)
await querySnapshot.forEach((doc) => {
console.log(new Date(doc._document.version.timestamp.seconds * 1000).toString())
//processing
})
I want to sort the orderby by "doc._document.version.timestamp.seconds" which is displayed in console.log.
But I don't know how to do it. This date is automatically registered by firestore, so the position of the value is different. Does anyone know how I can sort it?