Package step.core.collections.filesystem
Class FilesystemCollection<T>
- java.lang.Object
-
- step.core.collections.filesystem.AbstractCollection<T>
-
- step.core.collections.filesystem.FilesystemCollection<T>
-
- All Implemented Interfaces:
Collection<T>
public class FilesystemCollection<T> extends AbstractCollection<T> implements Collection<T>
-
-
Constructor Summary
Constructors Constructor Description FilesystemCollection(File repository, Class<T> entityClass)
-
Method Summary
All Methods Instance Methods Concrete 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)-
Methods inherited from class step.core.collections.filesystem.AbstractCollection
getId, setId
-
-
-
-
Method Detail
-
distinct
public List<String> distinct(String columnName, Filter filter)
- Specified by:
distinctin interfaceCollection<T>- Parameters:
columnName- the name of the column (field)filter- : the query filter- Returns:
- the distinct values of the column
-
count
public long count(Filter filter, Integer limit)
Description copied from interface:CollectionCounts the number of entities matching the provided filter- Specified by:
countin interfaceCollection<T>limit- the maximum number of documents to count. Nullable.- Returns:
- the number of entities matching the provided filter
-
estimatedCount
public long estimatedCount()
Description copied from interface:CollectionProvide an estimation of the total number of entities of the collection- Specified by:
estimatedCountin interfaceCollection<T>- Returns:
-
find
public Stream<T> find(Filter filter, SearchOrder order, Integer skip, Integer limit, int maxTime)
- Specified by:
findin interfaceCollection<T>- Returns:
-
findReduced
public Stream<T> findReduced(Filter filter, SearchOrder order, Integer skip, Integer limit, int maxTime, List<String> reduceFields)
- Specified by:
findReducedin interfaceCollection<T>
-
remove
public void remove(Filter filter)
- Specified by:
removein interfaceCollection<T>
-
save
public T save(T entity)
- Specified by:
savein interfaceCollection<T>
-
save
public void save(Iterable<T> entities)
- Specified by:
savein interfaceCollection<T>
-
createOrUpdateIndex
public void createOrUpdateIndex(String field)
- Specified by:
createOrUpdateIndexin interfaceCollection<T>
-
createOrUpdateCompoundIndex
public void createOrUpdateCompoundIndex(String... fields)
- Specified by:
createOrUpdateCompoundIndexin interfaceCollection<T>
-
rename
public void rename(String newName)
- Specified by:
renamein interfaceCollection<T>
-
drop
public void drop()
- Specified by:
dropin interfaceCollection<T>
-
-