Re-ordered functions in the mongbdb impl to group by collection type.