sanity
sanity copied to clipboard
Migration run executed with an error [Mutation failed: Syntax error, unable to parse entire expression]
Hello.
I want to run a migration to remove a non-existent field from documents. But it fires with an error.
Error: Mutation failed: Syntax error, unable to parse entire expression
This is my migration
import {defineMigration, at, unset} from 'sanity/migrate'
export default defineMigration({
title: 'remove text field from blockInvestmentObjective',
documentTypes: ['page'],
migrate: {
document(doc, context) {
return [
at("blocks[_type == \"blockInvestmentObjective\"].text", unset())
]
},
},
})
command
sanity documents validate returns this
my structure looks like this page->blocks->array ob page blocks