Only register types when MongoDB exists