code: private void onFlushCollection(Map<String, List<DBObject>> collections)
      {
          for (String tableName : collections.keySet())
          {
              DBCollection dbCollection = mongoDb.getCollection(tableName);
              KunderaCoreUtils.printQuery("Persist collection:" + tableName, showQuery);
              try
              {
                  dbCollection.insert(collections.get(tableName).toArray(new DBObject[0]), getWriteConcern(), encoder);
              }
              catch (MongoException ex)
              {
                  throw new KunderaException("document is not inserted in " + dbCollection.getFullName()
                          + " collection. Caused By:", ex);
              }
          }
  
      }
docs: On collections flush.
  
  @param collections
  collection containing records to be inserted in mongo db.