Package de.bwaldvogel.mongo.backend
Class AbstractMongoCollection<P>
java.lang.Object
de.bwaldvogel.mongo.backend.AbstractMongoCollection<P>
- All Implemented Interfaces:
MongoCollection<P>
- Direct Known Subclasses:
AbstractSynchronizedMongoCollection
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final CursorRegistryprotected final CollectionOptions -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractMongoCollection(MongoDatabase database, String collectionName, CollectionOptions options, CursorRegistry cursorRegistry) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDocument(Document document) protected abstract PaddDocumentInternal(Document document) voidintprotected CursorcreateCursor(List<Document> remainingDocuments) protected QueryResultcreateQueryResult(List<Document> matchedDocuments, int batchSize) intdeleteDocuments(Document selector, int limit, Oplog oplog) protected static DocumentComparatorderiveComparator(Document orderBy) protected booleandocumentMatchesQuery(Document document, Document query) voiddrop()voidfindAndModify(Document query) protected PfindDocumentPosition(Document document) protected abstract intprotected abstract DocumentgetDocument(P position) protected StringgetStats()getUuid()handleDistinct(Document query) handleQuery(QueryParameters queryParameters) protected abstract voidhandleUpdate(P position, Document oldDocument, Document newDocument) insertDocuments(List<Document> documents, boolean isOrdered) protected static booleanisNaturalDescending(Document orderBy) protected abstract QueryResultmatchDocuments(Document query, Document orderBy, int numberToSkip, int numberToReturn, int batchSize, Document fieldSelector) protected QueryResultmatchDocuments(Document query, Iterable<P> positions, Document orderBy, int numberToSkip, int limit, int batchSize, Document fieldSelector) protected QueryResultmatchDocumentsFromStream(Document query, Stream<Document> documentStream, int numberToSkip, int limit, int batchSize, Comparator<Document> documentComparator, Document fieldSelector) protected QueryResultmatchDocumentsFromStream(Stream<Document> documentStream, Document query, Document orderBy, int numberToSkip, int limit, int batchSize, Document fieldSelector) protected QueryResultqueryDocuments(Document query, Document orderBy, int numberToSkip, int limit, int batchSize, Document fieldSelector) voidremoveDocument(Document document) protected abstract voidremoveDocument(P position) voidrenameTo(MongoDatabase newDatabase, String newCollectionName) protected abstract Stream<DocumentWithPosition<P>> toString()protected booleanprotected abstract voidupdateDataSize(int sizeDelta) updateDocuments(Document selector, Document updateQuery, ArrayFilters arrayFilters, boolean isMulti, boolean isUpsert, Oplog oplog) validate()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface de.bwaldvogel.mongo.MongoCollection
addDocumentIfMissing, addDocuments, count, deleteDocuments, getDatabaseName, getFullName, getNumIndexes, handleQuery, handleQuery, handleQueryAsStream, insertDocuments, isEmpty, queryAll, queryAllAsStream
-
Field Details
-
options
-
cursorRegistry
-
-
Constructor Details
-
AbstractMongoCollection
protected AbstractMongoCollection(MongoDatabase database, String collectionName, CollectionOptions options, CursorRegistry cursorRegistry)
-
-
Method Details
-
getUuid
- Specified by:
getUuidin interfaceMongoCollection<P>
-
documentMatchesQuery
-
queryDocuments
protected QueryResult queryDocuments(Document query, Document orderBy, int numberToSkip, int limit, int batchSize, Document fieldSelector) -
matchDocuments
protected abstract QueryResult matchDocuments(Document query, Document orderBy, int numberToSkip, int numberToReturn, int batchSize, Document fieldSelector) -
matchDocumentsFromStream
-
matchDocumentsFromStream
protected QueryResult matchDocumentsFromStream(Document query, Stream<Document> documentStream, int numberToSkip, int limit, int batchSize, Comparator<Document> documentComparator, Document fieldSelector) -
matchDocuments
-
isNaturalDescending
-
deriveComparator
-
getDocument
-
updateDataSize
protected abstract void updateDataSize(int sizeDelta) -
getDataSize
protected abstract int getDataSize() -
addDocumentInternal
-
addDocument
- Specified by:
addDocumentin interfaceMongoCollection<P>
-
getDatabase
- Specified by:
getDatabasein interfaceMongoCollection<P>
-
getCollectionName
- Specified by:
getCollectionNamein interfaceMongoCollection<P>
-
toString
-
addIndex
- Specified by:
addIndexin interfaceMongoCollection<P>
-
drop
public void drop()- Specified by:
dropin interfaceMongoCollection<P>
-
dropIndex
- Specified by:
dropIndexin interfaceMongoCollection<P>
-
getIdField
-
findAndModify
- Specified by:
findAndModifyin interfaceMongoCollection<P>
-
handleQuery
- Specified by:
handleQueryin interfaceMongoCollection<P>
-
insertDocuments
- Specified by:
insertDocumentsin interfaceMongoCollection<P>
-
handleDistinct
- Specified by:
handleDistinctin interfaceMongoCollection<P>
-
deleteDocuments
- Specified by:
deleteDocumentsin interfaceMongoCollection<P>
-
updateDocuments
public Document updateDocuments(Document selector, Document updateQuery, ArrayFilters arrayFilters, boolean isMulti, boolean isUpsert, Oplog oplog) - Specified by:
updateDocumentsin interfaceMongoCollection<P>
-
handleUpdate
-
getIndexes
- Specified by:
getIndexesin interfaceMongoCollection<P>
-
count
- Specified by:
countin interfaceMongoCollection<P>
-
getStats
- Specified by:
getStatsin interfaceMongoCollection<P>
-
removeDocument
- Specified by:
removeDocumentin interfaceMongoCollection<P>
-
tracksDataSize
protected boolean tracksDataSize() -
validate
- Specified by:
validatein interfaceMongoCollection<P>
-
renameTo
- Specified by:
renameToin interfaceMongoCollection<P>
-
removeDocument
-
findDocumentPosition
-
streamAllDocumentsWithPosition
-
createQueryResult
-
createCursor
-