How many files are created by default using WiredTiger storage engine? So, I got a question on a test (without answer unfortunately) that left me with a big doubt whether it's true or false.

The question is this: "By default, WiredTiger storage engine creates one file per collection and per index".

I went to check all the documentation, but I couldn't find a really satisfying answer to this question. I would assume by logic that it of course creates one file per collection and one per index, but how to be sure about that? I think those files are managed by the DB system and thus are not visible to the user.

I just remember that somewhere there are the files of the database looking like dbname.0 and when it grows after a certain threshold, it creates another file dbname.1 etc. so I would assume the collection is inside that file and not a separate entity, thus making the test statement wrong?
Yes, WiredTiger Engine creates one file per collection and per index.

Files are the part of storage layer that is being maintained by the Storage Engine part. you can locate the created files in the dbpath specified in the configuration file used to start the server instance. For example in case if your underlying OS is ubuntu the default config file path is:

/etc/mongod.conf


In case of WiredTiger engine when you create any collection, then you will be able to find new files like:

collection-22--9037026691096837958.wt
index-23--9037026691096837958.wt


here numbers 22,23 indicates the unique identity of collection and index to the storage engine and being maintained withing the storage engine's metadata.

in last part of your question about threshold, you may be interested in storage capacity limits, so you can consider following these links:

https://docs.mongodb.com/manual/reference/limits/
https://stackoverflow.com/questions/4327723/mongodb-limit-storage-size