Never mind. I was using a mongodb driver of version 2.x. I upgraded to 3.x and the issue was resolved. Thanks for the response.