Posts

Showing posts from September, 2020

MongoDB - quick view of the "view"

Quick overview about Mongodb view A view is merely a saved aggregation pipeline that's called whenever you reference the name of the view as though you were querying a collection. You cannot modify the view Here are a few simply facts about MongoDB View: 1. It's read only 2. View must be created in the same db as the based collection 3. It's a good alternative to mask sensitive data 4. Cannot be renamed , do drop and create instead 5. It doesn't materialized, meaning view does not store anything but definition To create the view with real example: db . getSiblingDB("personnel-core").createView ( "nameView",name , [{                                         "$project" : {                                                 "fullName" : {                                                         "$concat" : [                                                                 "$firstName",