[mongodb] Update the pom.xml to make checkstyle fail the build. Updated code to satisfy the checkstyle validation.
Fixes #365