I'm trying to figure out how to console.log random documents from firestore. I've looked through Get nth document in a collection in Firestore, Select random document from Firestore, Firestore: How to get random documents in a collection, Get random documents from Firestore using Javascript, https://javascript.plainenglish.io/how-to-get-a-random-document-from-firebase-cloud-firestore-with-ionic-angular-a59940efb55e. I formatted some of these into vanilla js but nothing worked, got the # of docs in firestore and printed random numbers from that amount but got stuck after that. Is there some way to at least get the nth document in firestore or another way to get random documents?
The furthest I got was this which gets the number of docs in the collection, and picks 10 'numbers/orders' from it, and prints them.
firebase.firestore().collection('user').get().then(function(doc) {
size = doc.size
for(let i=0;i<10;i++){
var random = Math.floor((Math.random() * size));
firebase.firestore().collection("userInfo").where("userId",">=",random).get().then((querySnapshot) => {
// querySnapshot.forEach((doc) => {
// console.log(doc.data());
// });
// })