Data access and sharing data across teams or third parties are a very common phenomenon. Sharing sensitive data is a strict no. However, why even share data which is irrelevant for the data consumer.
Mongoose Discriminator is another very useful and powerful yet underused feature of Mongoose. It serves as a means of schema inheritance, allowing you to use multiple models with intersecting schemas on the same underlying MongoDB collection.
Pre and post middleware hooks is a very useful feature in Mongoose and provides a lot of flexibility during database operations like query, create, remove etc. Pre and post hooks are functions that are executed before or after a particular action that you specify.
Mongoose is a schema-based solution to model your application data in MongoDB. It includes built-in type casting, validation, query building, business logic hooks and more, out of the box.
Mongoose offers various methods to retrieve documents from a collection, such as find(), findOne(), and findById().
According to MDN, the Object.freeze() static method freezes an object. Freezing an object prevents extensions and makes existing properties non-writable and non-configurable. A frozen object can no longer be changed: new properties cannot be added, existing properties cannot be removed, their enumerability, configurability, writability, or value cannot be changed, and the object’s prototype cannot be re-assigned.
All Tags:
abortcontroller
1
abortsignal
1
access
1
aggregation-pipeline
1
async
3
aws
1
capped
1
clustering
1
data-processing
1
database
8
destructuring
1
es6
2
eslint
1
eventloop
1
expressjs
5
finally
1
grid
1
image-grid
1
indexing
1
ipc
1
javascript
20
loops
1
material-ui
1
mongodb
11
mongodb-compass
1
mongoose
4
nested
1
nodejs
20
nvm
1
object
1
performance
1
pino
2
prettier
1
reactjs
1
schema
2
security
1
streams
2
subdocument
1
tech
2
template-literals
1
time-to-live
1
timers
1
ttl-index
1
url
1
vscode
1