How can I simultaneously in one “click” event delete two documents from two collection in my cloud firestore?

June 13, 2019, at 00:40 AM

i just want to delete multiple documents from two different collections(hive and entry). how should i do this? with two promises or how?

my below code works but the moment I add "location.reload()" anywhere, only the clicked hive is deleted. the page just doesn't work with this refresh function...

please help... thanks in advance!

    deleteBtn.addEventListener('click', (e) => {
      let id ='data-id');
      var x = confirm("Deleting a hive will delete all its records.  Click 'Ok' to delete and 'Cancel' to return.");
// delete clicked hive
          .then(function () {
          .catch(function (error) {
// delete all entries from within clicked hive
        var deleteEntry = db.collection('entry').where('hive_id', "==", id);
          .then(function(querySnapshot) {
            querySnapshot.forEach(function(doc) {
          .catch(function (error) {

the above approach might be completely wrong and not i will just type my needed results here...

after clicking deleteBtn and confirming the delete, the clicked hive should be deleted and all entry records from that hive should also be deleted. the page needs to refresh and show that the hive is gone. (note that all entry records have the same hive will have the hives id as property)


return instruction stop my for-loop in javascript

return instruction stop my for-loop in javascript

when i use a for-loop there is no problem in

Webpack External Local Library

Webpack External Local Library

I want to setup my Webpack config (v4+) to exclude an import that is referencing a local libraryIn my app, I import this library like so:

Call Back not fired when listening to 'sync' event in service worker

Call Back not fired when listening to 'sync' event in service worker

I am listening to the 'sync' event in my service worker file but NOTHING happensEven my console