Revert "remove mongodb call in factories"

This reverts commit 1e86b3dbdb60b698b3b49b16ef149e0a8cd941e2.
remove dependency missing issue