Files
siv/db-data/2023-04-22-find-vote-by-auth.ts
2023-04-23 00:54:25 +03:00

23 lines
435 B
TypeScript

import './_env'
import { firebase } from '../pages/api/_services'
const election_id = '1680323766282'
const auth = ''
;(async () => {
const vote = await firebase
.firestore()
.collection('elections')
.doc(election_id)
.collection('votes')
.where('auth', '==', auth)
.get()
console.log('Found:', vote.docs.length)
const data = { ...vote.docs[0].data(), id: vote.docs[0].id }
console.log(data)
})()