MongoDB test code