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

153
Views
put request firebase realtime database

I am using real-time Database:

enter image description here

This is a put request in which users generate key onClick. This is working fine.

When a send user login from different device it just replaces the previous user.

enter image description here

It does not add a new user history

import axios from 'axios';

const endPoint = 'https://*_hide_.firebaseio.com/userHistory.json/'


export const UserHistory = (data) => {
     let token = localStorage.getItem('token')
     return axios.put(endPoint,JSON.stringify(data), {
        headers :{ 
           'Content-Type': 'application/json',
           'Authorization': 'Bearer'+ token
      }
   }) 
}
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Calling put on a path replaces any existing value at that path with the value that you specify.

If you want to add a new child node under the path, you should use post instead of put.

If you want to merge the data you specify with any existing values at the path, you should use patch instead of put.

For more on this, also see the Firebase documentation on writing data to the Realtime Database with its REST API.

about 4 years ago · Juan Pablo Isaza 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!