Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

281
Views
¿Cómo agrega datos a Firebase doc usando redux thunk getFireBase y getFirestore de react-redux-firebase?

Problema

  • Tengo problemas para agregar datos a la base de datos de firebase usando react-redux-thunk
  • Revisé la documentación y vi varios videos de YouTube, pero me encontré con un error tras otro.
  • Quiero agregar datos a un documento de firebase usando el middleware getFirestore y getFirebase de la biblioteca "redux-firestore" y "react-redux-firebase" respectivamente

Código

  • Aquí está la función de acción.
  • Parece que todo el código funciona, pero no sé cómo agregar validatonResults a users/uid (consulte el comentario en el código a continuación)
  • Probé el siguiente código (y muchas otras cosas) pero no funcionó firebase.push('users', { data: validatonResults })
 import inputValidationAPI from "../../apis/inputValidationAPI" export const validateTestCase = payload => { return (dispatch, getState, { getFirebase, getFirestore }) => { const fireStore = getFirestore() const firebase = getFirebase() const uid = getState().firebase.auth.uid inputValidationAPI .post("/submitTerm", { term: payload }) .then(response => { return response.data.data }) .then(validatonResults => { /* validationResults = ["string1", "string2", "string3"] I want to take validationResults and add them into firebase collection something like: firebase.push('todos/${uid}', { some: 'data' }) */ return validatonResults }) .then(validatonResults => { dispatch({ type: "VALIDATE_TESTCASE_SUCCESS", payload: validatonResults }) }) .catch(err => console.log(err)) } }
about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

La siguiente sintaxis resolvió esto:

 fireStore.update( { collection: "users", doc: uid }, { dataToSave: someJSONObject }, } )
about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!