Interface MongoQueryExecutor<E>
-
- Type Parameters:
E
- The entity type
public interface MongoQueryExecutor<E>
MongoDB specific repository that allows to use direct BSON objects.- Since:
- 3.3
- Author:
- Denis Stepanov
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description long
count(org.bson.conversions.Bson filter)
Count the records.long
deleteAll(org.bson.conversions.Bson filter)
Delete the records matching the filter.long
deleteAll(org.bson.conversions.Bson filter, com.mongodb.client.model.DeleteOptions options)
Delete the records matching the filter.java.util.List<E>
findAll(MongoFindOptions options)
Finds all results.Page<E>
findAll(MongoFindOptions options, Pageable pageable)
Finds a page of records.java.util.List<E>
findAll(java.lang.Iterable<org.bson.conversions.Bson> pipeline)
Finds all results.java.util.List<E>
findAll(java.lang.Iterable<org.bson.conversions.Bson> pipeline, MongoAggregationOptions options)
Finds all results.java.util.List<E>
findAll(org.bson.conversions.Bson filter)
Finds all results.Page<E>
findAll(org.bson.conversions.Bson filter, Pageable pageable)
Finds a page of records.java.util.Optional<E>
findOne(MongoFindOptions options)
Finds one result.java.util.Optional<E>
findOne(java.lang.Iterable<org.bson.conversions.Bson> pipeline)
Finds a page of records.java.util.Optional<E>
findOne(java.lang.Iterable<org.bson.conversions.Bson> pipeline, MongoAggregationOptions options)
Finds one result.java.util.Optional<E>
findOne(org.bson.conversions.Bson filter)
Finds one result.long
updateAll(org.bson.conversions.Bson filter, org.bson.conversions.Bson update)
Update the records matching the filter.long
updateAll(org.bson.conversions.Bson filter, org.bson.conversions.Bson update, com.mongodb.client.model.UpdateOptions options)
Update the records matching the filter.
-
-
-
Method Detail
-
findOne
java.util.Optional<E> findOne(@Nullable org.bson.conversions.Bson filter)
Finds one result.- Parameters:
filter
- The filter to be applied- Returns:
- The optional result
-
findOne
java.util.Optional<E> findOne(@NonNull MongoFindOptions options)
Finds one result.- Parameters:
options
- The options- Returns:
- The optional result
-
findAll
@NonNull java.util.List<E> findAll(@Nullable org.bson.conversions.Bson filter)
Finds all results.- Parameters:
filter
- The filter to be applied- Returns:
- The records
-
findAll
@NonNull java.util.List<E> findAll(@NonNull MongoFindOptions options)
Finds all results.- Parameters:
options
- The options- Returns:
- The records
-
findAll
@NonNull Page<E> findAll(@Nullable org.bson.conversions.Bson filter, @NonNull Pageable pageable)
Finds a page of records.- Parameters:
filter
- The filterpageable
- The pageable- Returns:
- The page
-
findAll
@NonNull Page<E> findAll(@NonNull MongoFindOptions options, @NonNull Pageable pageable)
Finds a page of records.- Parameters:
options
- The optionspageable
- The pageable- Returns:
- The page
-
findOne
java.util.Optional<E> findOne(@NonNull java.lang.Iterable<org.bson.conversions.Bson> pipeline)
Finds a page of records.- Parameters:
pipeline
- The pipeline to be applied- Returns:
- The optional result
-
findOne
java.util.Optional<E> findOne(@NonNull java.lang.Iterable<org.bson.conversions.Bson> pipeline, @NonNull MongoAggregationOptions options)
Finds one result.- Parameters:
pipeline
- The pipeline to be appliedoptions
- The aggregation options- Returns:
- The optional result
-
findAll
@NonNull java.util.List<E> findAll(@NonNull java.lang.Iterable<org.bson.conversions.Bson> pipeline)
Finds all results.- Parameters:
pipeline
- The pipeline to be applied- Returns:
- The results
-
findAll
@NonNull java.util.List<E> findAll(@NonNull java.lang.Iterable<org.bson.conversions.Bson> pipeline, @NonNull MongoAggregationOptions options)
Finds all results.- Parameters:
pipeline
- The pipeline to be appliedoptions
- The options- Returns:
- The results
-
count
long count(@Nullable org.bson.conversions.Bson filter)
Count the records.- Parameters:
filter
- The filter to be applied- Returns:
- The count
-
deleteAll
long deleteAll(@NonNull org.bson.conversions.Bson filter)
Delete the records matching the filter.- Parameters:
filter
- The filter to be applied- Returns:
- The deleted count
-
deleteAll
long deleteAll(@NonNull org.bson.conversions.Bson filter, @NonNull com.mongodb.client.model.DeleteOptions options)
Delete the records matching the filter.- Parameters:
filter
- The filter to be appliedoptions
- The delete options- Returns:
- The deleted count
-
updateAll
long updateAll(@NonNull org.bson.conversions.Bson filter, @NonNull org.bson.conversions.Bson update)
Update the records matching the filter.- Parameters:
filter
- The filter to be appliedupdate
- The update modification- Returns:
- The updated count
-
updateAll
long updateAll(@NonNull org.bson.conversions.Bson filter, @NonNull org.bson.conversions.Bson update, @NonNull com.mongodb.client.model.UpdateOptions options)
Update the records matching the filter.- Parameters:
filter
- The filter to be appliedupdate
- The update modificationoptions
- The update options- Returns:
- The updated count
-
-