public static ArrayList<Person> read(Person personIn){
		
		 ArrayList<Person> listPerson = new ArrayList<Person>();
		
		if(personIn == null){
		try {
			MongoClient mongoClient = new MongoClient( "127.0.0.1" , 27017 );
			DB db = mongoClient.getDB( "db" );
			DBCollection collection = db.getCollection("person");
			
			 DBCursor cursor =  collection.find();
			 while (cursor.hasNext()) {
				 	cursor.next();
				   Person person = new Person();
				   person.setId( (int) cursor.curr().get("_id"));
				   person.setFirstName((String) cursor.curr().get("firstName"));
				   person.setLastName((String) cursor.curr().get("lastName"));
				   person.setAge((int) cursor.curr().get("age"));  
				   
				   listPerson.add(person);
				  }
		} catch (UnknownHostException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		 
		}else{
			try {
				MongoClient mongoClient = new MongoClient( "127.0.0.1" , 27017 );
				DB db = mongoClient.getDB( "db" );
				DBCollection collection = db.getCollection("person");
				
				 DBCursor cursor =  collection.find(docForQuery(personIn));
				 while (cursor.hasNext()) {
					 	cursor.next();
					   Person person = new Person();
					   person.setId( (int) cursor.curr().get("_id"));
					   person.setFirstName((String) cursor.curr().get("firstName"));
					   person.setLastName((String) cursor.curr().get("lastName"));
					   person.setAge((int) cursor.curr().get("age"));  
					   
					   listPerson.add(person);
					  }
			} catch (UnknownHostException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
		
		return listPerson;
}