private void FillTable() throws UnknownHostException {
        MongoClient mongoClient = new MongoClient(database.getInstanceAddress());
        DB db = mongoClient.getDB(database.getDatabaseName());
        DBCollection collection = db.getCollection(database.CollectionName);
        DBObject dbObject = collection.findOne();
        Set<String> keySet = dbObject.keySet();

        for(final String key: keySet)
        {
            TableColumn<Hashtable,String> column = new TableColumn(key);
            column.setEditable(true);
            column.setCellValueFactory(new Callback<TableColumn.CellDataFeatures<Hashtable, String>, ObservableValue<String>>() {
                @Override
                public ObservableValue<String> call(TableColumn.CellDataFeatures<Hashtable, String> hashtableStringCellDataFeatures) {
                    return new SimpleStringProperty(hashtableStringCellDataFeatures.getValue().get(key).toString());
                }
            });

            tableView.getColumns().add(column);
        }
        pageSize = Integer.parseInt(pageSizeControl.getText());

        if (pageSize == 0 ) pageSize = 20;

        DBObject filterObject = new QueryBuilder().get();
        if (!filteringControl.getText().isEmpty()) {
            filterObject = (DBObject) JSON.parse(filteringControl.getText());
        }
        DBCursor cursor = collection.find(filterObject).skip(page * pageSize).limit(pageSize);
        ObservableList<Hashtable> data = FXCollections.observableArrayList();
        int pages = (int)Math.floor(cursor.count()/ pageSize);
        String pageText = "Page " + page + " of " + pages;
        pageNumberControl.setText(pageText);
        while(cursor.hasNext())
        {
            DBObject obj = cursor.next();
            Hashtable table = new Hashtable();

            for(String set: obj.keySet())
            {

                if(obj.get(set) != null) {
                    table.put(set, obj.get(set).toString());
                }
                else
                {
                    table.put(set,"nil");
                }

            }
            data.add(table);
        }
        tableView.setItems(data);
        tableView.setEditable(true);
    }