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
    Constructor
    Description
     
    MongoDBQuery(ai.platon.gora.store.DataStore<K,T> dataStore)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.bson.conversions.Bson
    toDBQuery(ai.platon.gora.query.Query<?,?> query)
    Compute the query itself.
    static org.bson.conversions.Bson
    toProjection(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

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • MongoDBQuery

      public MongoDBQuery()
    • MongoDBQuery

      public MongoDBQuery(ai.platon.gora.store.DataStore<K,T> dataStore)
  • 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 Document corresponding to the query
    • toProjection

      public static org.bson.conversions.Bson toProjection(String[] fields, MongoMapping mapping)
      Compute the projection of the query, that is the fields that will be retrieved from the database.
      Returns:
      a Document corresponding to the list of field to be retrieved with the associated boolean