samuk190 / localbase

A Firebase-Style Database ... Offline!
649 stars 83 forks source link

Checking if document exist does not work with If statement #70

Closed isipcasinillo closed 2 years ago

isipcasinillo commented 2 years ago

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') }