Fix checks for existing mapping and document count
Move empty/mapping check to connection
Improve connection
Merge pull request #12 from codemix/fix-console-checks

Fix checks for existing mapping and document count