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

Read only MongoDatabase mode? #6

Open
ipcamit opened this issue Jan 19, 2022 · 0 comments
Open

Read only MongoDatabase mode? #6

ipcamit opened this issue Jan 19, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@ipcamit
Copy link
Collaborator

ipcamit commented Jan 19, 2022

How feasible would be to have a MongoDatabase client which does not write to database at all. For lot of applications, dataset would be created and curated once but read several times.
It would be nice and more robust to have MongoDatabase(read_only=True) mode where it has two properties:

  1. During instantiation it checks if the database exists, else raises an exception if it does not.
  2. Any of the insert data methods do not write to the database but rather raise an exception of client being in read only mode

Added bonus: it can be used as archival method where once committed to some repository, clients can only have read-only access to maintain integrity. For that dataset would need additional property which can be manually toggle to enable write access or read access.

Quick google search reveal mongo does have read only user access. But I do not think that feature is as usefule.

@ipcamit ipcamit added the enhancement New feature or request label Jan 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant