👋 Next.js Conf 2024: Come build, party, run, and connect with us! See all events

Patching Insert an Array Field in a Query

1 replies
Last updated: Aug 9, 2022
when trying to patch insert an array, if the array is empty, it won't do anything and that array field is not even present in the query but is present in the dashboard UI.
Aug 9, 2022, 12:43 PM
Hey
user S
! You'll need to add a
setIfMissing
method as shown in this example.
Aug 9, 2022, 3:52 PM

Sanity– build remarkable experiences at scale

Sanity is a modern headless CMS that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.

Was this answer helpful?