samuk190 / localbase

A Firebase-Style Database ... Offline!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Checking if document exist does not work with If statement

isipcasinillo opened this issue · comments

the const x returns undefined but the code doesn't run and console log errors 'Could not find Document in "weatherDb" collection with criteria: {"city":"city"}'

const x = db.collection('weatherDb').doc({ city: city}).get() if( await x == 'undefined') { console.log('document does not exist') }