Query.TextSearchLanguages| Constructor and Description |
|---|
QueryImpl() |
QueryImpl(Morphium m) |
QueryImpl(Morphium m,
Class<? extends T> type,
ThreadPoolExecutor executor) |
| Modifier and Type | Method and Description |
|---|---|
Query<T> |
addChild(FilterExpression ex)
needed for creation of the query representation tree
|
Query<T> |
addProjection(Enum f) |
Query<T> |
addProjection(Enum f,
String projectOperator) |
Query<T> |
addProjection(String f) |
Query<T> |
addProjection(String f,
String projectOperator) |
Query<T> |
addTag(String name,
String value) |
MorphiumQueryIterator<T> |
asIterable()
create an iterator / iterable for this query, default windowSize (10), prefetch windows 1
|
MorphiumQueryIterator<T> |
asIterable(int windowSize)
create an iterator / iterable for this query, sets window size (how many objects should be read from DB)
prefetch number is 1 in this case
|
MorphiumQueryIterator<T> |
asIterable(int windowSize,
Class<? extends MorphiumQueryIterator<T>> it) |
MorphiumQueryIterator<T> |
asIterable(int windowSize,
int prefetchWindows)
create an iterator / iterable for this query, sets window size (how many entities are read en block) and how many windows of this size will be prefechted...
|
MorphiumQueryIterator<T> |
asIterable(MorphiumQueryIterator<T> ret) |
List<T> |
asList()
the result as list
|
void |
asList(AsyncOperationCallback<T> callback) |
MorphiumQueryIterator<Map<String,Object>> |
asMapIterable() |
List<Map<String,Object>> |
asMapList() |
Query<T> |
clone() |
List<T> |
complexQuery(Map<String,Object> query)
Deprecated.
|
List<T> |
complexQuery(Map<String,Object> query,
Map<String,Integer> sort,
int skip,
int limit)
Deprecated.
|
List<T> |
complexQuery(Map<String,Object> query,
String sort,
int skip,
int limit)
use rawQuery() instead
|
long |
complexQueryCount(Map<String,Object> query)
deprecated, use rawQuery and standard count() methods
|
T |
complexQueryOne(Map<String,Object> query)
same as copmplexQuery(query,0,1).get(0);
deprecated user rawQuery().get()
|
T |
complexQueryOne(Map<String,Object> query,
Map<String,Integer> sort)
deprecated, user rawQuery().get()
|
T |
complexQueryOne(Map<String,Object> query,
Map<String,Integer> sort,
int skip)
deprecated use rawQuery().get();
|
long |
countAll()
count all results in query - does not take limit or skip into account
|
void |
countAll(AsyncOperationCallback<T> c) |
void |
dec(Enum field,
Double value) |
void |
dec(Enum field,
Double value,
boolean upsert,
boolean multiple) |
void |
dec(Enum field,
Double value,
boolean upsert,
boolean multiple,
AsyncOperationCallback<T> cb) |
void |
dec(Enum field,
Integer value) |
void |
dec(Enum field,
Integer value,
boolean upsert,
boolean multiple) |
void |
dec(Enum field,
Integer value,
boolean upsert,
boolean multiple,
AsyncOperationCallback<T> cb) |
void |
dec(Enum field,
Long value) |
void |
dec(Enum field,
Long value,
boolean upsert,
boolean multiple) |
void |
dec(Enum field,
Long value,
boolean upsert,
boolean multiple,
AsyncOperationCallback<T> cb) |
void |
dec(Enum field,
Number value) |
void |
dec(Enum field,
Number value,
boolean upsert,
boolean multiple) |
void |
dec(Enum field,
Number value,
boolean upsert,
boolean multiple,
AsyncOperationCallback<T> cb) |
void |
dec(String field,
Double value) |
void |
dec(String field,
Double value,
boolean upsert,
boolean multiple) |
void |
dec(String field,
Double value,
boolean upsert,
boolean multiple,
AsyncOperationCallback<T> cb) |
void |
dec(String field,
Integer value) |
void |
dec(String field,
Integer value,
boolean upsert,
boolean multiple) |
void |
dec(String field,
Integer value,
boolean upsert,
boolean multiple,
AsyncOperationCallback<T> cb) |
void |
dec(String field,
Long value) |
void |
dec(String field,
Long value,
boolean upsert,
boolean multiple) |
void |
dec(String field,
Long value,
boolean upsert,
boolean multiple,
AsyncOperationCallback<T> cb) |
void |
dec(String field,
Number value) |
void |
dec(String field,
Number value,
boolean upsert,
boolean multiple) |
void |
dec(String field,
Number value,
boolean upsert,
boolean multiple,
AsyncOperationCallback<T> cb) |
void |
delete() |
Query<T> |
disableAutoValues() |
List |
distinct(String field) |
Query<T> |
enableAutoValues() |
Query<T> |
expr(Expr exp) |
MongoField<T> |
f(Enum... f) |
MongoField<T> |
f(Enum f)
same as f(field.name())
|
MongoField<T> |
f(String... f) |
MongoField<T> |
f(String f)
Get a field.
|
T |
findOneAndDelete() |
T |
findOneAndUpdate(Map<String,Object> update) |
T |
findOneAndUpdateEnums(Map<Enum,Object> update) |
T |
get()
get only 1 result (first one in result list)
|
void |
get(AsyncOperationCallback<T> callback) |
AnnotationAndReflectionHelper |
getARHelper() |
T |
getById(Object id)
Deprecated.
|
void |
getById(Object id,
AsyncOperationCallback<T> callback)
Deprecated.
|
Collation |
getCollation() |
String |
getCollectionName() |
String |
getDB()
return the DB name the query is going to be executed on or was executed on
|
ThreadPoolExecutor |
getExecutor() |
Map<String,Object> |
getFieldListForQuery() |
int |
getLimit() |
Morphium |
getMorphium() |
int |
getNumberOfPendingRequests() |
ReadPreferenceLevel |
getReadPreferenceLevel() |
String |
getServer()
returns the serveraddress the query was executed on
|
int |
getSkip() |
Map<String,Integer> |
getSort() |
String[] |
getTags() |
Class<? extends T> |
getType()
what type this query is for
|
String |
getWhere() |
Query<T> |
hideFieldInProjection(Enum f) |
Query<T> |
hideFieldInProjection(String f) |
<R> List<R> |
idList()
only return the IDs of objects (useful if objects are really large)
|
void |
idList(AsyncOperationCallback<T> callback) |
void |
inc(Enum field,
Double value) |
void |
inc(Enum field,
Double value,
boolean upsert,
boolean multiple) |
void |
inc(Enum field,
Double value,
boolean upsert,
boolean multiple,
AsyncOperationCallback<T> cb) |
void |
inc(Enum field,
Integer value) |
void |
inc(Enum field,
Integer value,
boolean upsert,
boolean multiple) |
void |
inc(Enum field,
Integer value,
boolean upsert,
boolean multiple,
AsyncOperationCallback<T> cb) |
void |
inc(Enum field,
Long value) |
void |
inc(Enum field,
Long value,
boolean upsert,
boolean multiple) |
void |
inc(Enum field,
Long value,
boolean upsert,
boolean multiple,
AsyncOperationCallback<T> cb) |
void |
inc(Enum field,
Number value) |
void |
inc(Enum field,
Number value,
boolean upsert,
boolean multiple) |
void |
inc(Enum field,
Number value,
boolean upsert,
boolean multiple,
AsyncOperationCallback<T> cb) |
void |
inc(String field,
Double value) |
void |
inc(String field,
Double value,
boolean upsert,
boolean multiple) |
void |
inc(String field,
Double value,
boolean upsert,
boolean multiple,
AsyncOperationCallback<T> cb) |
void |
inc(String field,
Integer value) |
void |
inc(String field,
Integer value,
boolean upsert,
boolean multiple) |
void |
inc(String field,
Integer value,
boolean upsert,
boolean multiple,
AsyncOperationCallback<T> cb) |
void |
inc(String field,
Long value) |
void |
inc(String field,
Long value,
boolean upsert,
boolean multiple) |
void |
inc(String field,
Long value,
boolean upsert,
boolean multiple,
AsyncOperationCallback<T> cb) |
void |
inc(String field,
Number value) |
void |
inc(String field,
Number value,
boolean upsert,
boolean multiple) |
void |
inc(String field,
Number value,
boolean upsert,
boolean multiple,
AsyncOperationCallback<T> cb) |
boolean |
isAutoValuesEnabled() |
Query<T> |
limit(int i)
limit the number of entries in result
|
Query<T> |
matchesJsonSchema(Map<String,Object> schemaDef) |
Query<T> |
matchesJsonSchema(String schemaDef) |
Query<T> |
nor(Query<T>... qs)
not or
|
Query<T> |
or(List<Query<T>> qs)
concatenate those queries with or
|
Query<T> |
or(Query<T>... qs)
concatenate those queries with or
|
void |
overrideDB(String overrideDB)
use this db instead of the default one
|
void |
pull(Enum field,
Expr value) |
void |
pull(Enum field,
Expr value,
boolean upsert,
boolean multiple) |
void |
pull(Enum field,
Expr value,
boolean upsert,
boolean multiple,
AsyncOperationCallback<T> cb) |
void |
pull(Enum field,
Object value) |
void |
pull(Enum field,
Object value,
boolean upsert,
boolean multiple,
AsyncOperationCallback<T> cb) |
void |
pull(String field,
Object value) |
void |
pull(String field,
Object value,
boolean upsert,
boolean multiple,
AsyncOperationCallback<T> cb) |
void |
pullAll(Enum field,
List value) |
void |
pullAll(Enum field,
List value,
boolean upsert,
boolean multiple,
AsyncOperationCallback<T> cb) |
void |
pullAll(String field,
List value) |
void |
pullAll(String field,
List value,
boolean upsert,
boolean multiple,
AsyncOperationCallback<T> cb) |
void |
push(Enum field,
Object value) |
void |
push(Enum field,
Object value,
boolean upsert,
boolean multiple,
AsyncOperationCallback<T> cb) |
void |
push(String field,
Object value) |
void |
push(String field,
Object value,
boolean upsert,
boolean multiple,
AsyncOperationCallback<T> cb) |
void |
pushAll(Enum field,
List value) |
void |
pushAll(Enum field,
List value,
boolean upsert,
boolean multiple,
AsyncOperationCallback<T> cb) |
void |
pushAll(String field,
List value) |
void |
pushAll(String field,
List value,
boolean upsert,
boolean multiple,
AsyncOperationCallback<T> cb) |
Query<T> |
q()
create a new empty query for the same type using the same mapper as this
|
Query<T> |
rawQuery(Map<String,Object> query) |
void |
set(Enum field,
Object value) |
void |
set(Enum field,
Object value,
AsyncOperationCallback<T> cb) |
void |
set(Enum field,
Object value,
boolean upsert,
boolean multiple) |
void |
set(Enum field,
Object value,
boolean upsert,
boolean multiple,
AsyncOperationCallback<T> cb) |
void |
set(Map<String,Object> map) |
void |
set(Map<String,Object> map,
AsyncOperationCallback<T> cb) |
void |
set(Map<String,Object> map,
boolean upsert,
boolean multiple) |
void |
set(Map<String,Object> map,
boolean upsert,
boolean multiple,
AsyncOperationCallback<T> cb) |
void |
set(String field,
Object value) |
void |
set(String field,
Object value,
AsyncOperationCallback<T> cb) |
void |
set(String field,
Object value,
boolean upsert,
boolean multiple) |
void |
set(String field,
Object value,
boolean upsert,
boolean multiple,
AsyncOperationCallback<T> cb) |
void |
setARHelper(AnnotationAndReflectionHelper ar) |
Query<T> |
setAutoValuesEnabled(boolean autoValuesEnabled) |
Query<T> |
setCollation(Collation collation) |
Query<T> |
setCollectionName(String n)
use a different collection name for the query
|
void |
setEnum(Map<Enum,Object> map) |
void |
setEnum(Map<Enum,Object> map,
AsyncOperationCallback<T> cb) |
void |
setEnum(Map<Enum,Object> map,
boolean upsert,
boolean multiple) |
void |
setEnum(Map<Enum,Object> map,
boolean upsert,
boolean multiple,
AsyncOperationCallback<T> cb) |
void |
setExecutor(ThreadPoolExecutor executor) |
void |
setMorphium(Morphium m) |
Query<T> |
setProjection(Enum... fl) |
Query<T> |
setProjection(String... fl) |
void |
setReadPreferenceLevel(ReadPreferenceLevel readPreferenceLevel) |
void |
setType(Class<? extends T> type)
what type to use
|
Query<T> |
skip(int i)
skip the first entries in result
|
Query<T> |
sort(Enum... naturalOrder) |
Query<T> |
sort(Map<String,Integer> n)
this does not check for existence of the Field!
|
Query<T> |
sort(String... prefixedString)
set order by prefixing field names with - for reverse ordering (+ or nothing default)
|
Query<T> |
sortEnum(Map<Enum,Integer> n) |
void |
tail(int batchSize,
int maxWait,
AsyncOperationCallback<T> cb)
do a tail query
|
Query<T> |
text(Query.TextSearchLanguages lang,
boolean caseSensitive,
boolean diacriticSensitive,
String... text) |
Query<T> |
text(Query.TextSearchLanguages lang,
String... text) |
Query<T> |
text(String... text) |
Query<T> |
text(String metaScoreField,
Query.TextSearchLanguages lang,
boolean caseSensitive,
boolean diacriticSensitive,
String... text) |
Query<T> |
text(String metaScoreField,
Query.TextSearchLanguages lang,
String... text) |
List<T> |
textSearch(Query.TextSearchLanguages lang,
String... texts)
Deprecated.
|
List<T> |
textSearch(String... texts)
Deprecated.
|
Map<String,Object> |
toQueryObject()
create a db object from this query and all of it's child nodes
|
String |
toString() |
Query<T> |
where(String wh)
set the where string for this query - where-String needs to be valid java script!
|
public QueryImpl()
public QueryImpl(Morphium m, Class<? extends T> type, ThreadPoolExecutor executor)
public QueryImpl(Morphium m)
public Collation getCollation()
getCollation in interface Query<T>public Query<T> setCollation(Collation collation)
setCollation in interface Query<T>public String getDB()
Querypublic void overrideDB(String overrideDB)
QueryoverrideDB in interface Query<T>public Query<T> disableAutoValues()
disableAutoValues in interface Query<T>public Query<T> enableAutoValues()
enableAutoValues in interface Query<T>public boolean isAutoValuesEnabled()
isAutoValuesEnabled in interface Query<T>public Query<T> setAutoValuesEnabled(boolean autoValuesEnabled)
setAutoValuesEnabled in interface Query<T>public String getServer()
Querypublic ThreadPoolExecutor getExecutor()
public void setExecutor(ThreadPoolExecutor executor)
setExecutor in interface Query<T>public Morphium getMorphium()
getMorphium in interface Query<T>public void setMorphium(Morphium m)
setMorphium in interface Query<T>public ReadPreferenceLevel getReadPreferenceLevel()
getReadPreferenceLevel in interface Query<T>public void setReadPreferenceLevel(ReadPreferenceLevel readPreferenceLevel)
setReadPreferenceLevel in interface Query<T>public Query<T> q()
Query@Deprecated public List<T> complexQuery(Map<String,Object> query)
complexQuery in interface Query<T>query - public List<T> complexQuery(Map<String,Object> query, String sort, int skip, int limit)
complexQuery in interface Query<T>query - sort - skip - limit - public T findOneAndDelete()
findOneAndDelete in interface Query<T>public T findOneAndUpdate(Map<String,Object> update)
findOneAndUpdate in interface Query<T>public T findOneAndUpdateEnums(Map<Enum,Object> update)
findOneAndUpdateEnums in interface Query<T>public AnnotationAndReflectionHelper getARHelper()
getARHelper in interface Query<T>public void setARHelper(AnnotationAndReflectionHelper ar)
setARHelper in interface Query<T>public long complexQueryCount(Map<String,Object> query)
QuerycomplexQueryCount in interface Query<T>@Deprecated public List<T> complexQuery(Map<String,Object> query, Map<String,Integer> sort, int skip, int limit)
complexQuery in interface Query<T>query - - query to be sentsort - skip - - amount to skiplimit - - maximium number of resultspublic Map<String,Object> getFieldListForQuery()
getFieldListForQuery in interface Query<T>public T complexQueryOne(Map<String,Object> query)
QuerycomplexQueryOne in interface Query<T>query - - querypublic T complexQueryOne(Map<String,Object> query, Map<String,Integer> sort, int skip)
QuerycomplexQueryOne in interface Query<T>public T complexQueryOne(Map<String,Object> query, Map<String,Integer> sort)
QuerycomplexQueryOne in interface Query<T>public Query<T> addChild(FilterExpression ex)
Querypublic Query<T> where(String wh)
Querypublic MongoField<T> f(Enum f)
Querypublic MongoField<T> f(String f)
Query@SafeVarargs public final Query<T> or(Query<T>... qs)
Querypublic Query<T> or(List<Query<T>> qs)
Query@SafeVarargs public final Query<T> nor(Query<T>... qs)
Querypublic Query<T> limit(int i)
Querypublic Query<T> skip(int i)
Querypublic Query<T> sort(Map<String,Integer> n)
public Query<T> sort(String... prefixedString)
Querypublic void countAll(AsyncOperationCallback<T> c)
public long countAll()
Querypublic Map<String,Object> toQueryObject()
QuerytoQueryObject in interface Query<T>public Query<T> matchesJsonSchema(Map<String,Object> schemaDef)
matchesJsonSchema in interface Query<T>public Query<T> matchesJsonSchema(String schemaDef) throws org.json.simple.parser.ParseException
matchesJsonSchema in interface Query<T>org.json.simple.parser.ParseExceptionpublic Class<? extends T> getType()
Querypublic void setType(Class<? extends T> type)
Querypublic void asList(AsyncOperationCallback<T> callback)
public MorphiumQueryIterator<Map<String,Object>> asMapIterable()
asMapIterable in interface Query<T>public MorphiumQueryIterator<T> asIterable()
QueryasIterable in interface Query<T>public MorphiumQueryIterator<T> asIterable(int windowSize)
QueryasIterable in interface Query<T>public MorphiumQueryIterator<T> asIterable(MorphiumQueryIterator<T> ret)
asIterable in interface Query<T>public MorphiumQueryIterator<T> asIterable(int windowSize, Class<? extends MorphiumQueryIterator<T>> it)
asIterable in interface Query<T>public MorphiumQueryIterator<T> asIterable(int windowSize, int prefetchWindows)
QueryasIterable in interface Query<T>@Deprecated public void getById(Object id, AsyncOperationCallback<T> callback)
@Deprecated public T getById(Object id)
Querypublic void get(AsyncOperationCallback<T> callback)
public T get()
Querypublic void idList(AsyncOperationCallback<T> callback)
public <R> List<R> idList()
Querypublic void set(String field, Object value, boolean upsert, boolean multiple, AsyncOperationCallback<T> cb)
public void set(Enum field, Object value, boolean upsert, boolean multiple, AsyncOperationCallback<T> cb)
public void setEnum(Map<Enum,Object> map, boolean upsert, boolean multiple, AsyncOperationCallback<T> cb)
public void set(Map<String,Object> map, boolean upsert, boolean multiple, AsyncOperationCallback<T> cb)
public void set(String field, Object value, AsyncOperationCallback<T> cb)
public void set(Enum field, Object value, AsyncOperationCallback<T> cb)
public void setEnum(Map<Enum,Object> map, AsyncOperationCallback<T> cb)
public void set(Map<String,Object> map, AsyncOperationCallback<T> cb)
public void push(String field, Object value, boolean upsert, boolean multiple, AsyncOperationCallback<T> cb)
public void push(Enum field, Object value, boolean upsert, boolean multiple, AsyncOperationCallback<T> cb)
public void pushAll(String field, List value, boolean upsert, boolean multiple, AsyncOperationCallback<T> cb)
public void pushAll(Enum field, List value, boolean upsert, boolean multiple, AsyncOperationCallback<T> cb)
public void pullAll(String field, List value, boolean upsert, boolean multiple, AsyncOperationCallback<T> cb)
public void pullAll(Enum field, List value, boolean upsert, boolean multiple, AsyncOperationCallback<T> cb)
public void pull(String field, Object value, boolean upsert, boolean multiple, AsyncOperationCallback<T> cb)
public void pull(Enum field, Object value, boolean upsert, boolean multiple, AsyncOperationCallback<T> cb)
public void pull(Enum field, Expr value, boolean upsert, boolean multiple, AsyncOperationCallback<T> cb)
public void inc(String field, Integer value, boolean upsert, boolean multiple, AsyncOperationCallback<T> cb)
public void inc(String field, Double value, boolean upsert, boolean multiple, AsyncOperationCallback<T> cb)
public void inc(Enum field, Number value, boolean upsert, boolean multiple, AsyncOperationCallback<T> cb)
public void inc(Enum field, Integer value, boolean upsert, boolean multiple, AsyncOperationCallback<T> cb)
public void inc(Enum field, Double value, boolean upsert, boolean multiple, AsyncOperationCallback<T> cb)
public void inc(Enum field, Long value, boolean upsert, boolean multiple, AsyncOperationCallback<T> cb)
public void inc(String field, Long value, boolean upsert, boolean multiple, AsyncOperationCallback<T> cb)
public void inc(String field, Number value, boolean upsert, boolean multiple, AsyncOperationCallback<T> cb)
public void dec(Enum field, Integer value, boolean upsert, boolean multiple, AsyncOperationCallback<T> cb)
public void dec(String field, Integer value, boolean upsert, boolean multiple, AsyncOperationCallback<T> cb)
public void dec(Enum field, Double value, boolean upsert, boolean multiple, AsyncOperationCallback<T> cb)
public void dec(String field, Double value, boolean upsert, boolean multiple, AsyncOperationCallback<T> cb)
public void dec(Enum field, Long value, boolean upsert, boolean multiple, AsyncOperationCallback<T> cb)
public void dec(String field, Long value, boolean upsert, boolean multiple, AsyncOperationCallback<T> cb)
public void dec(Enum field, Number value, boolean upsert, boolean multiple, AsyncOperationCallback<T> cb)
public void dec(String field, Number value, boolean upsert, boolean multiple, AsyncOperationCallback<T> cb)
public int getNumberOfPendingRequests()
getNumberOfPendingRequests in interface Query<T>public String getCollectionName()
getCollectionName in interface Query<T>public Query<T> setCollectionName(String n)
QuerysetCollectionName in interface Query<T>public Query<T> text(Query.TextSearchLanguages lang, String... text)
public Query<T> text(Query.TextSearchLanguages lang, boolean caseSensitive, boolean diacriticSensitive, String... text)
public Query<T> text(String metaScoreField, Query.TextSearchLanguages lang, boolean caseSensitive, boolean diacriticSensitive, String... text)
public Query<T> text(String metaScoreField, Query.TextSearchLanguages lang, String... text)
@Deprecated public List<T> textSearch(String... texts)
textSearch in interface Query<T>@Deprecated public List<T> textSearch(Query.TextSearchLanguages lang, String... texts)
textSearch in interface Query<T>public Query<T> setProjection(Enum... fl)
setProjection in interface Query<T>public Query<T> setProjection(String... fl)
setProjection in interface Query<T>public Query<T> addProjection(Enum f, String projectOperator)
addProjection in interface Query<T>public Query<T> addProjection(Enum f)
addProjection in interface Query<T>public Query<T> addProjection(String f)
addProjection in interface Query<T>public Query<T> addProjection(String f, String projectOperator)
addProjection in interface Query<T>public Query<T> hideFieldInProjection(String f)
hideFieldInProjection in interface Query<T>public void tail(int batchSize,
int maxWait,
AsyncOperationCallback<T> cb)
public Query<T> hideFieldInProjection(Enum f)
hideFieldInProjection in interface Query<T>Copyright © 2022. All rights reserved.