Skip to content

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.

2 participants