Package step.core.collections
Interface Collection<T>
-
- All Known Implementing Classes:
FilesystemCollection,InMemoryCollection
public interface Collection<T>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description longcount(Filter filter, Integer limit)Counts the number of entities matching the provided filtervoidcreateOrUpdateCompoundIndex(String... fields)voidcreateOrUpdateIndex(String field)List<String>distinct(String columnName, Filter filter)voiddrop()longestimatedCount()Provide an estimation of the total number of entities of the collectionStream<T>find(Filter filter, SearchOrder order, Integer skip, Integer limit, int maxTime)Stream<T>findReduced(Filter filter, SearchOrder order, Integer skip, Integer limit, int maxTime, List<String> reduceFields)voidremove(Filter filter)voidrename(String newName)voidsave(Iterable<T> entities)Tsave(T entity)
-
-
-
Method Detail
-
count
long count(Filter filter, Integer limit)
Counts the number of entities matching the provided filter- Parameters:
filter-limit- the maximum number of documents to count. Nullable.- Returns:
- the number of entities matching the provided filter
-
estimatedCount
long estimatedCount()
Provide an estimation of the total number of entities of the collection- Returns:
-
find
Stream<T> find(Filter filter, SearchOrder order, Integer skip, Integer limit, int maxTime)
- Parameters:
filter-order-skip-limit-maxTime-- Returns:
-
findReduced
Stream<T> findReduced(Filter filter, SearchOrder order, Integer skip, Integer limit, int maxTime, List<String> reduceFields)
-
distinct
List<String> distinct(String columnName, Filter filter)
- Parameters:
columnName- the name of the column (field)filter- : the query filter- Returns:
- the distinct values of the column
-
remove
void remove(Filter filter)
-
createOrUpdateIndex
void createOrUpdateIndex(String field)
-
createOrUpdateCompoundIndex
void createOrUpdateCompoundIndex(String... fields)
-
rename
void rename(String newName)
-
drop
void drop()
-
-