Merge branch 'hotfix/#6351-license-header'

Close #6351
Fixes #6281
change == to ===
move logic into __construct
Merge branch 'hotfix/#6361-fix-#6281-mongodb-saveoptions-not-recognized' into develop

Forward port #6361