This is too reductive, you can essentially have flexible schemas with most modern relational databases and without the downsides of document-based DBs.
In 99% of the cases, even if you need a flexible schema, PostgreSQL will remain the best choice.
In 99% of the cases, even if you need a flexible schema, PostgreSQL will remain the best choice.