This repository has been archived by the owner on Jan 19, 2024. It is now read-only.
feat: add indexAutomatically option to disable middleware hooks #50
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Please rename option to Thanks. |
nodkz
suggested changes
Oct 27, 2018
README.md
Outdated
- `bulk.batch` - [batchSize](https://docs.mongodb.com/manual/reference/method/cursor.batchSize/) to use on synchronise options. Defaults to 50. | ||
- `bulk.size` - bulk element count to wait before calling `client.bulk` function. Defaults to 1000. | ||
- `bulk.delay` - idle time to wait before calling the `client.bulk` function. Defaults to 1000. | ||
- `onlyOnDemandIndexing` - whether or not to automatically index on CRUD operations. If set to false mexp middleware hooks for save, delete, update do not fire. Defaults to true. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- whether or not to automatically index on CRUD operations. If set to false mexp middleware hooks for save, delete, update do not fire. Defaults to true.
+ whether or not to automatically index on CRUD operations. If set to true mexp middleware hooks for save, delete, update do not fire. Defaults to false.
onlyOnDemandIndexing: true
- means that indexing should be called manually. Current implementation breaks my mind ;)) Please fix it.
FYI You also may use Filtered Indexing https://github.com/jbdemonte/mongoose-elasticsearch-xp#filtered-indexing. When some field in model has proper values, then doc be send or removed from ES index. |
Make proper changes myself directly to master |
@florianbepunkt thanks for PR |
nodkz
added a commit
that referenced
this pull request
Oct 29, 2018
@florianbepunkt Version 5.6.0 was just published to npm. |
Will do so this week. Thank you.
…On Mon, Oct 29, 2018 at 3:31 PM Pavel Chertorogov ***@***.***> wrote:
@florianbepunkt <https://github.com/florianbepunkt> Version 5.6.0 was
just published to npm.
Please try it with your app.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#50 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AH7dWsj6l89ja2kvOmZyQONOsQPh173uks5upxE4gaJpZM4X9Zv8>
.
|
@nodkz Working great, thank you |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
closes #49
indexAutomatically option is set to true by default. when set to false, middleware hooks are not fired which allows for more fine grained control over when a document should be indexed/removed