Skip to content

Commit

Permalink
Added post update hook
Browse files Browse the repository at this point in the history
  • Loading branch information
Sundarasan committed Jul 24, 2017
1 parent 04872fd commit cf5d9b7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/mongoosastic.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit cf5d9b7

Please sign in to comment.