Changed MongoAlchemy.init_app so it takes app.config.get('MONGOALCHEMY_SAFE_SESSION', False) into account.
This allows users to create a safe session.
Also changed Document.save() to accept safe keyword. If safe==None (default), it will be set to Session.safe in mongoalchemy.
This is necessary if you have unique or sparse indexes.
Changed
MongoAlchemy.init_app
so it takesapp.config.get('MONGOALCHEMY_SAFE_SESSION', False)
into account. This allows users to create a safe session. Also changedDocument.save()
to accept safe keyword. Ifsafe==None
(default), it will be set toSession.safe
in mongoalchemy.This is necessary if you have unique or sparse indexes.