Adding a Wildcard When Using Client.Patch(...)

1 replies
Last updated: Jul 12, 2022
Hello! Is it possible to add a wildcard when using client.patch(...) to match several ids?

client
  .patch('*bike-123')

client
  .patch('*${bikeID}')

Jul 12, 2022, 8:37 AM
Hey
user E
! No, you can't patch in that way. If you need to patch multiple documents, you can first query for them, then loop through to perform your patch.
Jul 12, 2022, 6:57 PM

Sanity.io – build remarkable experiences at scale

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

Categorized in