code: @When("^I execute a query '(.+?)' of type '(json|string)' in mongo '(.+?)' database using collection '(.+?)' with:$")
      public void sendQueryOfType(String query, String type, String database, String collection, DataTable modifications) throws Exception {
          try {
              commonspec.setResultsType("mongo");
              String retrievedData = commonspec.retrieveData(query, type);
              String modifiedData = commonspec.modifyData(retrievedData, type, modifications);
              commonspec.getMongoDBClient().connectToMongoDBDataBase(database);
              DBCollection dbCollection = commonspec.getMongoDBClient().getMongoDBCollection(collection);
              DBObject dbObject = (DBObject) JSON.parse(modifiedData);
              DBCursor cursor = dbCollection.find(dbObject);
              commonspec.setMongoResults(cursor);
          } catch (Exception e) {
              commonspec.getExceptions().add(e);
          }
      }
docs: Execute a query on (mongo) database
  
  @param query         path to query
  @param type          type of data in query (string or json)
  @param collection    collection in database
  @param modifications modifications to perform in query