Package fr.gouv.vitam.common.database.translators.mongodb

# Class QueryToMongodb

java.lang.Object
fr.gouv.vitam.common.database.translators.mongodb.QueryToMongodb

public class QueryToMongodb extends Object
Query to MongoDB

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static org.bson.conversions.Bson`
  `getCommand(Query query)`
  `protected static Iterable<org.bson.conversions.Bson>`
  `getCommands(List<Query> queries)`
  `static org.bson.conversions.Bson`
  `getFullCommand(org.bson.conversions.Bson command, org.bson.conversions.Bson roots)`
  Merge a request and a root filter
  `static org.bson.conversions.Bson`
  `getRoots(String field, Collection<String> roots)`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Method Details

  - ### getRoots

    public static org.bson.conversions.Bson getRoots(String field, Collection<String> roots)
    Parameters:
      `field` - String
      `roots` - Set of String
    Returns:
      the filter associated with the roots

  - ### getFullCommand

    public static org.bson.conversions.Bson getFullCommand(org.bson.conversions.Bson command, org.bson.conversions.Bson roots)
    Merge a request and a root filter
    Parameters:
      `command` - Bson
      `roots` - Bson
    Returns:
      the complete request

  - ### getCommand

    public static org.bson.conversions.Bson getCommand(Query query) throws InvalidParseOperationException
    Parameters:
      `query` - Query
    Returns:
      the associated MongoDB BSON request
    Throws:
      `InvalidParseOperationException` - if query could not parse to command

  - ### getCommands

    protected static Iterable<org.bson.conversions.Bson> getCommands(List<Query> queries)