You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi there. I am stuck on how to check that an item does not exist. I would do the following using vanilla IndexDB like so:
const user_exists = db.transaction('user_data').objectStore('user_data').get(user.id);
user_exists.onsuccess = ()=> {
if (!user_exists.result) {
// Do the thing
}
}
How would I do so using LocalBase? I have tried the following but the error is never caught:
db.collection('user_data').doc({ id: user.id }).get().then(document => {
console.log(document)
}).catch(error => {
// Could do the thing here if this worked
})
Thank you!
The text was updated successfully, but these errors were encountered:
Hi there. I am stuck on how to check that an item does not exist. I would do the following using vanilla IndexDB like so:
How would I do so using LocalBase? I have tried the following but the error is never caught:
Thank you!
The text was updated successfully, but these errors were encountered: