Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MongoClient missing in filter plugin input #668

Closed
pvkas opened this issue Mar 8, 2023 · 1 comment · Fixed by #669
Closed

MongoClient missing in filter plugin input #668

pvkas opened this issue Mar 8, 2023 · 1 comment · Fixed by #669

Comments

@pvkas
Copy link
Contributor

pvkas commented Mar 8, 2023

Hey @rwynn I was exploring this tool and found there is missing MongoClient in input argument for Filter plugin.
Not sure if there was purpose for keeping the input partial. (Bug or Intentional ?)

There are some use cases where it can be very useful.

Example:

Suppose we have users collections to be synced and some data related to user is stored in different collection or database.
(ex. reports, pending actions, ...).
If we want to allow users with certain criteria. Currently, we can not access input.MongoClient (nil) in Filter function to perform all database operations.

Solution

@rwynn
Copy link
Owner

rwynn commented Mar 12, 2023

Hi @pvkas,

I think the initial reason behind not passing the client to the Filter in golang was to keep consistency with the javascript map/filter where we don't have access to the client. However, I think at some point I added the client to the Golang Map function input, so now see no reason why not Filter also.

Thanks for bringing to my attention and submitting a PR. I will take a quick look and merge it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants