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

Close #6361
Close #6281