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

103
Visualizações
Remove a child object in Fauna DB

I need to remove a child object in FQL. Let me demonstrate with the following example:

{
    "1": {
        "name": "test"
    },
    "2": {
        "name": "test2"
    }
}

And I want this JSON to look like this:

{
    "1": {
        "name": "test"
    }
}

Is there an FQL function that could help me?

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

When you set a key's value to null in Fauna, it is removed from the object. In your example, assuming ref is a valid Reference:

Update(ref, { "2": null })

will remove the key "2" and its associated value from the object, leaving you with:

{ "1": { "name": "test" } }
about 4 years ago · Juan Pablo Isaza Relatório

0

For a bare object, you can use the Merge function to remove object keys by setting their value to null:

> Merge({"1": { "name": "test" }, "2": { "name": "test2" }}, { "2": null })
{ '1': { name: 'test' } }
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