Class MongoDBDocumentManager

java.lang.Object
org.eclipse.jnosql.databases.mongodb.communication.MongoDBDocumentManager
All Implemented Interfaces:
AutoCloseable, org.eclipse.jnosql.communication.semistructured.DatabaseManager

public class MongoDBDocumentManager extends Object implements org.eclipse.jnosql.communication.semistructured.DatabaseManager
The mongodb implementation to DatabaseManager that does not support TTL methods insert(CommunicationEntity, Duration) Closing a MongoDBDocumentManager has no effect.
  • Method Summary

    Modifier and Type
    Method
    Description
    Stream<org.eclipse.jnosql.communication.semistructured.CommunicationEntity>
    aggregate(String collectionName, List<org.bson.conversions.Bson> pipeline)
    Aggregates documents according to the specified aggregation pipeline.
    Stream<Map<String,org.bson.BsonValue>>
    aggregate(String collectionName, org.bson.conversions.Bson... pipeline)
    Aggregates documents according to the specified aggregation pipeline.
    void
    Closing a MongoDBDocumentManager has no effect.
    long
    count(String documentCollection)
     
    long
    count(String collectionName, org.bson.conversions.Bson filter)
    Returns the number of documents in the collection that match the given query filter.
    long
    count(org.eclipse.jnosql.communication.semistructured.SelectQuery query)
     
    long
    delete(String collectionName, org.bson.conversions.Bson filter)
    Removes all documents from the collection that match the given query filter.
    void
    delete(org.eclipse.jnosql.communication.semistructured.DeleteQuery query)
     
    Iterable<org.eclipse.jnosql.communication.semistructured.CommunicationEntity>
    insert(Iterable<org.eclipse.jnosql.communication.semistructured.CommunicationEntity> entities)
     
    Iterable<org.eclipse.jnosql.communication.semistructured.CommunicationEntity>
    insert(Iterable<org.eclipse.jnosql.communication.semistructured.CommunicationEntity> entities, Duration ttl)
     
    org.eclipse.jnosql.communication.semistructured.CommunicationEntity
    insert(org.eclipse.jnosql.communication.semistructured.CommunicationEntity entity)
     
    org.eclipse.jnosql.communication.semistructured.CommunicationEntity
    insert(org.eclipse.jnosql.communication.semistructured.CommunicationEntity entity, Duration ttl)
     
     
    Stream<org.eclipse.jnosql.communication.semistructured.CommunicationEntity>
    select(String collectionName, org.bson.conversions.Bson filter)
    Finds all documents in the collection.
    Stream<org.eclipse.jnosql.communication.semistructured.CommunicationEntity>
    select(org.eclipse.jnosql.communication.semistructured.SelectQuery query)
     
    Iterable<org.eclipse.jnosql.communication.semistructured.CommunicationEntity>
    update(Iterable<org.eclipse.jnosql.communication.semistructured.CommunicationEntity> entities)
     
    org.eclipse.jnosql.communication.semistructured.CommunicationEntity
    update(org.eclipse.jnosql.communication.semistructured.CommunicationEntity entity)
     
    Iterable<org.eclipse.jnosql.communication.semistructured.CommunicationEntity>
    update(org.eclipse.jnosql.communication.semistructured.UpdateQuery query)
     

    Methods inherited from class java.lang.Object

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

    Methods inherited from interface org.eclipse.jnosql.communication.semistructured.DatabaseManager

    deleteAndCount, exists, prepare, prepare, query, query, selectCursor, singleResult
  • Method Details

    • name

      public String name()
      Specified by:
      name in interface org.eclipse.jnosql.communication.semistructured.DatabaseManager
    • insert

      public org.eclipse.jnosql.communication.semistructured.CommunicationEntity insert(org.eclipse.jnosql.communication.semistructured.CommunicationEntity entity)
      Specified by:
      insert in interface org.eclipse.jnosql.communication.semistructured.DatabaseManager
    • insert

      public org.eclipse.jnosql.communication.semistructured.CommunicationEntity insert(org.eclipse.jnosql.communication.semistructured.CommunicationEntity entity, Duration ttl)
      Specified by:
      insert in interface org.eclipse.jnosql.communication.semistructured.DatabaseManager
    • insert

      public Iterable<org.eclipse.jnosql.communication.semistructured.CommunicationEntity> insert(Iterable<org.eclipse.jnosql.communication.semistructured.CommunicationEntity> entities)
      Specified by:
      insert in interface org.eclipse.jnosql.communication.semistructured.DatabaseManager
    • insert

      public Iterable<org.eclipse.jnosql.communication.semistructured.CommunicationEntity> insert(Iterable<org.eclipse.jnosql.communication.semistructured.CommunicationEntity> entities, Duration ttl)
      Specified by:
      insert in interface org.eclipse.jnosql.communication.semistructured.DatabaseManager
    • update

      public org.eclipse.jnosql.communication.semistructured.CommunicationEntity update(org.eclipse.jnosql.communication.semistructured.CommunicationEntity entity)
      Specified by:
      update in interface org.eclipse.jnosql.communication.semistructured.DatabaseManager
    • update

      public Iterable<org.eclipse.jnosql.communication.semistructured.CommunicationEntity> update(Iterable<org.eclipse.jnosql.communication.semistructured.CommunicationEntity> entities)
      Specified by:
      update in interface org.eclipse.jnosql.communication.semistructured.DatabaseManager
    • update

      public Iterable<org.eclipse.jnosql.communication.semistructured.CommunicationEntity> update(org.eclipse.jnosql.communication.semistructured.UpdateQuery query)
      Specified by:
      update in interface org.eclipse.jnosql.communication.semistructured.DatabaseManager
    • delete

      public void delete(org.eclipse.jnosql.communication.semistructured.DeleteQuery query)
      Specified by:
      delete in interface org.eclipse.jnosql.communication.semistructured.DatabaseManager
    • select

      public Stream<org.eclipse.jnosql.communication.semistructured.CommunicationEntity> select(org.eclipse.jnosql.communication.semistructured.SelectQuery query)
      Specified by:
      select in interface org.eclipse.jnosql.communication.semistructured.DatabaseManager
    • count

      public long count(org.eclipse.jnosql.communication.semistructured.SelectQuery query)
      Specified by:
      count in interface org.eclipse.jnosql.communication.semistructured.DatabaseManager
    • count

      public long count(String documentCollection)
      Specified by:
      count in interface org.eclipse.jnosql.communication.semistructured.DatabaseManager
    • close

      public void close()
      Closing a MongoDBDocumentManager has no effect.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface org.eclipse.jnosql.communication.semistructured.DatabaseManager
    • delete

      public long delete(String collectionName, org.bson.conversions.Bson filter)
      Removes all documents from the collection that match the given query filter. If no documents match, the collection is not modified.
      Parameters:
      collectionName - the collection name
      filter - the delete filter
      Returns:
      the number of documents deleted.
      Throws:
      NullPointerException - when filter or collectionName is null
    • aggregate

      public Stream<Map<String,org.bson.BsonValue>> aggregate(String collectionName, org.bson.conversions.Bson... pipeline)
      Aggregates documents according to the specified aggregation pipeline.
      Parameters:
      collectionName - the collection name
      pipeline - the aggregation pipeline
      Returns:
      the stream of BSON Documents
      Throws:
      NullPointerException - when filter or collectionName is null
    • aggregate

      public Stream<org.eclipse.jnosql.communication.semistructured.CommunicationEntity> aggregate(String collectionName, List<org.bson.conversions.Bson> pipeline)
      Aggregates documents according to the specified aggregation pipeline.
      Parameters:
      collectionName - the collection name
      pipeline - the aggregation pipeline
      Returns:
      the stream result
      Throws:
      NullPointerException - when pipeline or collectionName is null
    • select

      public Stream<org.eclipse.jnosql.communication.semistructured.CommunicationEntity> select(String collectionName, org.bson.conversions.Bson filter)
      Finds all documents in the collection.
      Parameters:
      collectionName - the collection name
      filter - the query filter
      Returns:
      the stream result
      Throws:
      NullPointerException - when filter or collectionName is null
    • count

      public long count(String collectionName, org.bson.conversions.Bson filter)
      Returns the number of documents in the collection that match the given query filter.
      Parameters:
      collectionName - the collection name
      filter - the query filter
      Returns:
      the number of documents founded.
      Throws:
      NullPointerException - when filter or collectionName is null