Package ai.platon.gora.mongodb.query
Class MongoDBQuery<K,T extends ai.platon.gora.persistency.impl.PersistentBase>
java.lang.Object
ai.platon.gora.query.impl.QueryBase<K,T>
ai.platon.gora.mongodb.query.MongoDBQuery<K,T>
- All Implemented Interfaces:
ai.platon.gora.query.Query<K,,T> org.apache.hadoop.conf.Configurable,org.apache.hadoop.io.Writable
public class MongoDBQuery<K,T extends ai.platon.gora.persistency.impl.PersistentBase>
extends ai.platon.gora.query.impl.QueryBase<K,T>
MongoDB specific implementation of the
Query interface.- Author:
- Fabien Poulard fpoulard@dictanova.com
-
Field Summary
Fields inherited from class ai.platon.gora.query.impl.QueryBase
conf, dataStore, endKey, endTime, fields, filter, limit, localFilterEnabled, queryString, startKey, startTime -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.bson.conversions.BsontoDBQuery(ai.platon.gora.query.Query<?, ?> query) Compute the query itself.static org.bson.conversions.BsontoProjection(String[] fields, MongoMapping mapping) Compute the projection of the query, that is the fields that will be retrieved from the database.Methods inherited from class ai.platon.gora.query.impl.QueryBase
equals, execute, getConf, getDataStore, getEndKey, getEndTime, getFields, getFilter, getKey, getLimit, getStartKey, getStartTime, getTimestamp, hashCode, isLocalFilterEnabled, readFields, setConf, setDataStore, setEndKey, setEndTime, setFields, setFilter, setKey, setKeyRange, setLimit, setLocalFilterEnabled, setStartKey, setStartTime, setTimeRange, setTimestamp, toString, write
-
Constructor Details
-
MongoDBQuery
public MongoDBQuery() -
MongoDBQuery
-
-
Method Details
-
toDBQuery
public static org.bson.conversions.Bson toDBQuery(ai.platon.gora.query.Query<?, ?> query) Compute the query itself. Only make use of the keys for querying.- Returns:
- a
Documentcorresponding to the query
-
toProjection
Compute the projection of the query, that is the fields that will be retrieved from the database.- Returns:
- a
Documentcorresponding to the list of field to be retrieved with the associated boolean
-