Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

220
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda