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

172
Visualizações
"backfilling nulls in array of links are not supported" MongoDB / Realm

when I try to add new items to an array inside a document I get this error. As far as I know, the item references do exist in the MongoDB database.

The error i get is:

[
  "To resolve this issue please update or replace the document in MongoDB to make sure it abides by the schema.",
  "Change Event Type: update",
  "Namespace: app.CompanyLocation",
  "Partition: dag1f7g7102aecdd3e9467711e",
  "Document ID: ObjectID(\"61f7f74a2aecdd3e9467711f\")",
  "Detailed Error: cannot insert link at index 7 of array at path { table: \"CompanyLocation\", fullPath: \"units\" }, array has 6 elements and backfilling nulls in array of links are not supported",
  "Number of Unsyncable Documents: 1"
]

The code causing the error is:

 const newUnits = result.Shipment.Units[0].Unit.map(u => u._attributes.UID +  u._attributes.PSN).flat();
  console.log(newUnits);
  if(importResult.success){
  // Lägg till den som inventory på platsen.
  context.services.get("mongodb-atlas")
  .db("app")
  .collection("CompanyLocation")
  .updateOne(
    {
      _id: new BSON.ObjectId(place), 
      _partition: partition}, 
      {
        $push: {
          units: {
            $each: newUnits
          }
          
        }
        
      }
    )
  console.log(newUnits);
}

My question is: What may be causing this & What does the error message mean?

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

0

Seems like this is a problem with MongoDB version 5. Discussion and answers were found in the MongoDB community forum: https://www.mongodb.com/community/forums/t/cannot-insert-link-at-index-7-of-array-at-path-table-companylocation-fullpath-units-array-has-6-elements-and-backfilling-nulls-in-array-of-links-are-not-supported/151342

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