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

217
Views
JavaScript Query A Field In Firebase with a Space

So I've built out a flutter app, but have been struggling to integrate notifications. After a lot of testing, I am like 99.99% to the solution - but just have one thing that is frustrating the heck out of me! I'm using firebase and most of the code is dart, but in my cloud functions index.js file I'm working with JavaScript for the first time.

My database is structured like soenter image description here

I am able to retrieve the Host value using the code below - however, I can't figure out how to get the event name!! I understand that best practice may be to just not use spaces when creating the fields, but I already have a bunch of data and don't want to go through the entire database/code to switch all of the references. I tried a bunch of things such as putting it in brackets, quotes, using _, -, +, but I just can't figure out how to retrieve it!

I'm sure I'm just being dumb.... is there a super simple solution to retrieve the Event Name using the snapshot?

enter image description here

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

0

In JavaScript you can use both dot notation (e.g. object.property) and array notation (e.g. object["property"]) to access properties of an object.

So to get a field with a space in the you can use the latter:

snapshot.data()["Event Name"]
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!