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

307
Views
How can I change the left parameter as String while writing in my Firebase Realtime Database in Functions?

My Code to write into the database:

rdb.ref(`users/${userid}`).update({
            name : username,
            `${mystring}` : 1,
            `${mystring2}` : 2
        });

The connection and the writing works, but only the first line. In JavaScript the Syntax to pass a variable to a String should be :

`string${variable}`

Am I wrong or is this a bug?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Like @Jeremy said, Strings need brackets around:

rdb.ref(`users/${userid}`).update({
            name : username,
            [`${mystring}`] : 1,
            [`${mystring2}`] : 2
        });
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!