Giter Site home page Giter Site logo

Comments (7)

smomin avatar smomin commented on May 30, 2024 1

@Haroenv The partialUpdate was used to manage race conditions that could occur from the cold start up of the Cloud functions. Before this approach, I had an extra call to the Firestore db to sync up the records after then Cloud Function was warmed up, but this would be a Firestore cost.

I am currently considering looping through the payload for null values. If I encounter any fields with null values, i will use the saveObject method. However, I will have to make a call to Firestore db to refresh the data just in case if the data has changed.

from firestore-algolia-search.

smomin avatar smomin commented on May 30, 2024

Currently this is not possible with the approach I have taken. I am thinking through an approach that will clean up null attributes. Will update when I have a solution.

from firestore-algolia-search.

smomin avatar smomin commented on May 30, 2024

How often are you setting attributes to null? Can you send me examples so I can see if there are alternative solutions I can think through?

from firestore-algolia-search.

asentris avatar asentris commented on May 30, 2024

The attributes aren't set to null very often. Example: a document may have an attribute that was mistakenly given a value (by a user), so it is later corrected to null.

from firestore-algolia-search.

Haroenv avatar Haroenv commented on May 30, 2024

https://discourse.algolia.com/t/deleting-attributes-in-partial-updates/10154 I think we might be better off updating the objects altogether instead of partially updating. It doesn't have a difference in cost and will solve this issue. Deleting objects alltogether isn't solved by just swapping partialUpdate to save though

from firestore-algolia-search.

Haroenv avatar Haroenv commented on May 30, 2024

this issue is a duplicate of #60

from firestore-algolia-search.

saifurrehmanx avatar saifurrehmanx commented on May 30, 2024

@Haroenv The partialUpdate was used to manage race conditions that could occur from the cold start up of the Cloud functions. Before this approach, I had an extra call to the Firestore db to sync up the records after then Cloud Function was warmed up, but this would be a Firestore cost.

I am currently considering looping through the payload for null values. If I encounter any fields with null values, i will use the saveObject method. However, I will have to make a call to Firestore db to refresh the data just in case if the data has changed.

Ok but what if someone uses firebase.firestore.FieldValue.delete() to remove the field?

from firestore-algolia-search.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.