Class MongoDBQueryEvaluator
java.lang.Object
fr.inria.rules.integraal.storage.external.evaluator.MongoDBQueryEvaluator
- All Implemented Interfaces:
NativeQueryEvaluator<String, com.mongodb.client.MongoCursor<org.bson.Document>>
public class MongoDBQueryEvaluator
extends Object
implements NativeQueryEvaluator<String, com.mongodb.client.MongoCursor<org.bson.Document>>
Sends a MongoDB query
This evaluator uses com.mongodb
MongoClient to send the query.
The result is a MongoCursor- Author:
- Florent Tornil
-
Constructor Summary
ConstructorsConstructorDescriptionMongoDBQueryEvaluator(String uri, String database_name, String collection_name) Creates a new driver over the given mongodb stringMongoDBQueryEvaluator(String host, String user, String password, String database, String collection) Creates a new driver using the given parameters -
Method Summary
-
Constructor Details
-
MongoDBQueryEvaluator
public MongoDBQueryEvaluator(String host, String user, String password, String database, String collection) Creates a new driver using the given parameters- Parameters:
host- the hostname/IP of the databaseuser- the username used to connect to the databasepassword- the password used to connect to the databasedatabase- the database namecollection- the collection name
-
MongoDBQueryEvaluator
-
-
Method Details
-
evaluate
Description copied from interface:NativeQueryEvaluatorEvaluate the given query and returns the result This should not do anymore work- Specified by:
evaluatein interfaceNativeQueryEvaluator<String, com.mongodb.client.MongoCursor<org.bson.Document>>- Parameters:
query- to evaluate- Returns:
- an optional which contains the results of the query if everything went right, an empty optional otherwise
-