question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

References in arrays and non-existent are lost when updating any field in a document

See original GitHub issue

Thanks for making Vuefire, it’s great!

I have a bound object that has an array of references as one of the fields: image

For existing references in the array everything works well, however thing break when I add a new entry into that array with

firestore.collection("logs").doc(this.log.id)
    .update({
        photos: 
            firebase.firestore.FieldValue.arrayUnion(doc.ref)
    });
});

I end up with the right data inside firestore, but in Vue, the new entry in the array is loaded as a string instead of an Object: image

If I re-bind the object, everything is fine.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:4
  • Comments:12 (3 by maintainers)

github_iconTop GitHub Comments

6reactions
posvacommented, Dec 29, 2019

I found the problem and a solution. I need to refactor some of the code and write unit tests before releasing a new version. I will probably be able to in a week or so 🙂

Read more comments on GitHub >

github_iconTop Results From Across the Web

MongoDB $set item in array which does not exists with object ...
This is working in mongodb version v4.0.9. I have tested your usecase in my machine. db.collection.update( { "_id": ...
Read more >
db.collection.update() — MongoDB Manual
Modifies an existing document or documents in a collection. The method can modify specific fields of an existing document or documents or replace...
Read more >
Array Functions | Couchbase Docs
A new array, concatenated from the input arrays. If any of the input expr arguments or one of the array elements are MISSING...
Read more >
Adding data | Firestore - Google Cloud
This guide explains how to use the set, add, or update individual documents in Firestore. If you want to write data in bulk,...
Read more >
Add data to Cloud Firestore - Firebase - Google
Set a document. Data types; Custom objects. Add a document; Update a document. Server Timestamp; Update fields in nested objects; Update elements in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found