diff --git a/lib/mongoosastic.js b/lib/mongoosastic.js index 7d85f668..ff5aa1e0 100644 --- a/lib/mongoosastic.js +++ b/lib/mongoosastic.js @@ -812,6 +812,9 @@ function Mongoosastic (schema, pluginOpts) { inSchema.post('insertMany', (docs) => { docs.forEach((doc) => postSave(doc)) }) + inSchema.post('update', function () { + this.model.synchronize(this.getQuery()) + }) } if (indexAutomatically) {