Skip to content

Read only MongoDatabase mode? #6

Description

@ipcamit

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions