<commit_before><?php

require('../vendor/autoload.php');

class MyMongoClient
{
	var $connection;
	var $ini_array;
	var $dbname;
	var $collection;
	
	public function __construct($mongo_url,$ini_array)
	{
		$this->connection = new MongoDB\Client($mongo_url);
		$this->ini_array = $ini_array;
	}
	
	public function selectDB($dbname)
	{
		$this->dbname = $this->ini_array['Mongo'][$dbname];
		$collection_name = $this->ini_array['Mongo']['collection'];
		/*$this->collection = $connection->$dbname->$collection_name;*/
		$this->collection = $this->connection->$dbname->$collection_name;
	}
	
	public function find($query, $fields=null){
		$fields = array('projection' => $fields);
		if(!is_null($fields))
			return $this->collection->find($query,$fields);
		return $this->collection->find($query);
	}
	
	public function find_with_projection($query, $fields=null)
	{
		$fields = array('projection' => $fields);
		return $this->find($query,$fields);
	}
}<commit_msg>corretto baco mongodb<commit_after><?php

require('../vendor/autoload.php');

class MyMongoClient
{
	var $connection;
	var $ini_array;
	var $dbname;
	var $collection;
	
	public function __construct($mongo_url,$ini_array)
	{
		$this->connection = new MongoDB\Client($mongo_url);
		$this->ini_array = $ini_array;
	}
	
	public function selectDB($dbname)
	{
		$this->dbname = $this->ini_array['Mongo'][$dbname];
		$collection_name = $this->ini_array['Mongo']['collection'];
		/*$this->collection = $connection->$dbname->$collection_name;*/
		$this->collection = $this->connection->$dbname->$collection_name;
	}
	
	public function find($query, $fields=null){
		if(!is_null($fields))
			return $this->collection->find($query,$fields);
		return $this->collection->find($query);
	}
	
	public function find_with_projection($query, $fields_to_include=null)
	{
		$fields = array('projection' => $fields_to_include);
		return $this->find($query,$fields);
	}
}
{'fraction_non_alphanumeric': 0.18553459119496854, 'fraction_numerical': 0.0, 'mean_word_length': 5.674825174825175, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 40, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '620695', 'n_tokens_mistral': 703, 'n_tokens_neox': 659, 'n_words': 103}