If a database does not exist, MongoDB creates the database when you
first store data for that database. As such, you can switch to a
non-existent database and perform the following operation in the
mongo shell:

MongoDB provides the db.createCollection() method to
explicitly create a collection with various options, such as setting
the maximum size or the documentation validation rules. If you are not
specifying these options, you do not need to explicitly create the
collection since MongoDB creates new collections when you first store
data for the collections.

By default, a collection does not require its documents to have the
same schema; i.e. the documents in a single collection do not need to
have the same set of fields and the data type for a field can differ
across documents within a collection.