Prepare max to handle auth and non-auth mongodbs