diff --git a/Managing Documents/scripted-updates.md b/Managing Documents/scripted-updates.md index 2f9de30..0db227b 100644 --- a/Managing Documents/scripted-updates.md +++ b/Managing Documents/scripted-updates.md @@ -78,9 +78,10 @@ POST /products/_update/100 if (ctx._source.in_stock < 0) { ctx.op = 'delete'; } - - ctx._source.in_stock--; + else { + ctx._source.in_stock--; + } """ } } -``` \ No newline at end of file +```