Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

219
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda