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

173
Views
Error al insertar un valor en una matriz en Sanity.io

Así que estoy usando sanity .patch() para insertar datos dentro de una matriz. Pero recibo continuamente este error:

 Error: insert(at, selector, items) takes an "at"-argument which is one of: "before", "after", "replace"

Aquí está mi código de referencia:

publicar.js

 // ... { name: "peopleLiked", title: "People Liked", type: "array", of: [{ type: "string" }] }

Donde lo estoy usando:

 client.patch(id) .insert({ "before": `peopleLiked.array[0]`, "items": [auth.currentUser.displayName] })

Alguien puede ayudar.

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

0

La sintaxis de inserción es incorrecta, al mirar los documentos , debería estar en la línea de:

client.patch(id).insert('before', 'peopleLiked', [{"items": [auth.currentUser.displayName]}])

No estoy familiarizado con Cordura, pero parece que también necesitará .commit() después del parche

Espero que ayude

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!