Automatically updating a record using count() of another collection I have been looking at the docs and searching for videos on my problem, but I find nothing. I have a db called HPDASH where I have 2 collections, scripts and serverList. My problem is that I want to create a field for serverList that has the count() of the collection scripts. 

I have tried this: 
db.scripts.insert([{name: 'local_script'}, {name: 'qidsloader'}]) 
db.serverList.insert({script_count: db.scripts.count() }) 

The problem is that when I insert another record to scripts, the data on scripts_count stays as 2.

Is it possible to achieve this on MongoDB?
As you have noticed, MongoDB doesn't support naturally triggers. So, you need "programming skills" to do that functionality. You can use mongoTriggers, what can installed with mongo-triggers npm package.