add mongodb support and tests