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 TypeMethodDescriptionStream<org.eclipse.jnosql.communication.semistructured.CommunicationEntity>Aggregates documents according to the specified aggregation pipeline.Aggregates documents according to the specified aggregation pipeline.voidclose()Closing aMongoDBDocumentManagerhas no effect.longlongReturns the number of documents in the collection that match the given query filter.longcount(org.eclipse.jnosql.communication.semistructured.SelectQuery query) longRemoves all documents from the collection that match the given query filter.voiddelete(org.eclipse.jnosql.communication.semistructured.DeleteQuery query) Iterable<org.eclipse.jnosql.communication.semistructured.CommunicationEntity>Iterable<org.eclipse.jnosql.communication.semistructured.CommunicationEntity>insert(Iterable<org.eclipse.jnosql.communication.semistructured.CommunicationEntity> entities, Duration ttl) org.eclipse.jnosql.communication.semistructured.CommunicationEntityinsert(org.eclipse.jnosql.communication.semistructured.CommunicationEntity entity) org.eclipse.jnosql.communication.semistructured.CommunicationEntityname()Stream<org.eclipse.jnosql.communication.semistructured.CommunicationEntity>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>org.eclipse.jnosql.communication.semistructured.CommunicationEntityupdate(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, waitMethods inherited from interface org.eclipse.jnosql.communication.semistructured.DatabaseManager
deleteAndCount, exists, prepare, prepare, query, query, selectCursor, singleResult
-
Method Details
-
name
- Specified by:
namein interfaceorg.eclipse.jnosql.communication.semistructured.DatabaseManager
-
insert
public org.eclipse.jnosql.communication.semistructured.CommunicationEntity insert(org.eclipse.jnosql.communication.semistructured.CommunicationEntity entity) - Specified by:
insertin interfaceorg.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:
insertin interfaceorg.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:
insertin interfaceorg.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:
insertin interfaceorg.eclipse.jnosql.communication.semistructured.DatabaseManager
-
update
public org.eclipse.jnosql.communication.semistructured.CommunicationEntity update(org.eclipse.jnosql.communication.semistructured.CommunicationEntity entity) - Specified by:
updatein interfaceorg.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:
updatein interfaceorg.eclipse.jnosql.communication.semistructured.DatabaseManager
-
update
public Iterable<org.eclipse.jnosql.communication.semistructured.CommunicationEntity> update(org.eclipse.jnosql.communication.semistructured.UpdateQuery query) - Specified by:
updatein interfaceorg.eclipse.jnosql.communication.semistructured.DatabaseManager
-
delete
public void delete(org.eclipse.jnosql.communication.semistructured.DeleteQuery query) - Specified by:
deletein interfaceorg.eclipse.jnosql.communication.semistructured.DatabaseManager
-
select
public Stream<org.eclipse.jnosql.communication.semistructured.CommunicationEntity> select(org.eclipse.jnosql.communication.semistructured.SelectQuery query) - Specified by:
selectin interfaceorg.eclipse.jnosql.communication.semistructured.DatabaseManager
-
count
public long count(org.eclipse.jnosql.communication.semistructured.SelectQuery query) - Specified by:
countin interfaceorg.eclipse.jnosql.communication.semistructured.DatabaseManager
-
count
- Specified by:
countin interfaceorg.eclipse.jnosql.communication.semistructured.DatabaseManager
-
close
public void close()Closing aMongoDBDocumentManagerhas no effect.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceorg.eclipse.jnosql.communication.semistructured.DatabaseManager
-
delete
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 namefilter- 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 namepipeline- 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 namepipeline- 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 namefilter- the query filter- Returns:
- the stream result
- Throws:
NullPointerException- when filter or collectionName is null
-
count
Returns the number of documents in the collection that match the given query filter.- Parameters:
collectionName- the collection namefilter- the query filter- Returns:
- the number of documents founded.
- Throws:
NullPointerException- when filter or collectionName is null
-