In SQL we have a scheme script that creates tables which has some logic where it will set values based on something e.g A Merchant table where we set a url field based on the environment i.e. for dev environment it will be set to dev.com, for qa environment it will be set to qa.com
I know you can use mongoimport to run in the collection data but this is only for static data.
How can you run in a collection where you need to do some logic to set a value also in the collection?
You can write scripts that execute like you are in the shell. There, you can handle your operations as you want. The scripts makes it easier to execute large sets of instructions and logic (of course you need to write it in Javascript)