// Perform the operation here only.
Mongo mongoInstance = authService.getMongoInstance(connectionId);
long count = mongoInstance.getDB(dbName).getCollection(collectionName).count();
DBCursor cursor = mongoInstance.getDB(dbName).getCollection(collectionName).find();
if (!allKeys)
cursor.limit(10);
DBObject doc = new BasicDBObject();
Set<String> completeSet = new HashSet<String>();
while (cursor.hasNext()) {
doc = cursor.next();
getNestedKeys(doc, completeSet, "");