New features
Explore the documentation for the latest features introduced in the V1 release.
Last updated
Explore the documentation for the latest features introduced in the V1 release.
Last updated
In MongoDB, views are virtual collections created using aggregation pipelines, which allow you to transform and present data without physically storing it as a new collection.
A view in MongoDB is essentially a query that’s saved and accessible like a collection, but without actually storing any data. Views are read-only, which means you cannot modify data directly in a view. They are generated using aggregation pipelines, which transform and filter the underlying data from one or more source collections.
A MongoDB view is defined by an aggregation pipeline, which can be a series of stages to filter, group, sort, or transform documents from the source collection(s). When you query a view, MongoDB applies the defined aggregation stages to the source data on-the-fly, creating a "virtual" collection that shows the result of the pipeline.
In MEDomicsLab, views primarily help prevent the creation of redundant dataset copies by enabling flexible data representation and access.
They allow for simplified representations of complex data. For instance, you might have a large, detailed collection with multiple fields, but you create a view that only exposes the fields most relevant to certain users or applications.
Views also facilitate direct access to processed data, supporting analytics like features extraction, models training, and other computed insights, making it easier for the each module to access the processed data directly.
In MEDomicsLab, MongoDB Views are utilized to provide previews of datasets following a particular process, such as removing a column.
In this example:
once the delete "Text" column button is pressed, a preview panel appears, offering options to confirm, cancel, or save the changes as a view. Selecting "confirm changes" will apply the changes directly to the original dataset (i.e. will delete the "Text" column):
while choosing "save as view" will create a new MongoDB View, preserving the changes in a separate collection. This new view will then appear in your workspace, allowing you to interact with the modified dataset without affecting the original:
MongoDB views provide flexibility in how you present and control access to data, allowing you to tailor data views to the needs of different users without modifying the original collections.