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

MongoDB: Filter Enforcer #2

Open
wants to merge 1 commit into
base: mongodb_dbref
Choose a base branch
from
Open

Conversation

nsaje
Copy link
Collaborator

@nsaje nsaje commented May 20, 2024

Adds a configuration option to enforce a filter (or a set of them) on a particular collection (or more).

Simple example: the following configuration

mongodb.required-filters=books:author_id

will reject queries without a WHERE clause on author_id when selecting from books, e.g.

trino> select * from "bookscatalog".booksdb.books;

Query 20240520_095959_00000_fk3a5, FAILED, 1 node
Splits: 1 total, 0 done (0.00%)
0.48 [0 rows, 0B] [0 rows/s, 0B/s]

Query 20240520_095959_00000_fk3a5 failed: Collection 'books' requires a filter on 'author_id'!

A more complex with multiple fields required on the same collection, and a single field on a different collection:

mongodb.required-filters=books:author_id,books:publisher_id,authors:id

@nsaje nsaje force-pushed the mongodb_filter_enforcer branch from 2087b42 to 47c334d Compare May 22, 2024 09:39
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 this pull request may close these issues.

1 participant