Fix undefined function on mongo adapter