I want to get random data from collection expect the given value.
async function selectCompany(companyName) {
const vouchercompany = [];
try{
await db.collection('companies')
.where ('companyName' ,'!=' , companyName)
.get()
.then((querySnapshot) => {
querySnapshot.forEach((doc) => {
vouchercompany.push(doc.data())
})
})
return vouchercompany;
} catch(error) { json(error.message) }
Any suggestion would be helpful