public class DBQuery extends Object
DBCollection.query(DBQuery)
Modifier and Type | Field and Description |
---|---|
static int |
FLG_QUERY_FOR_UPDATE
When the transaction is turned on and the transaction isolation level is "RC", the transaction lock will be
released after the record is read by default.
|
static int |
FLG_QUERY_FORCE_HINT
Force to use specified hint to query,
if database has no index assigned by the hint, fail to query.
|
static int |
FLG_QUERY_KEEP_SHARDINGKEY_IN_UPDATE
The sharding key in update rule is not filtered,
when executing queryAndUpdate.
|
static int |
FLG_QUERY_PARALLED
Enable parallel sub-query, each sub-query will finish scanning different part of data.
|
static int |
FLG_QUERY_PREPARE_MORE
Enable prepare more data when querying.
|
static int |
FLG_QUERY_STRINGOUT
Normally, query return bson object,
when this flag is added, query return binary data stream
|
static int |
FLG_QUERY_WITH_RETURNDATA
In general, query won't return data until cursor gets the record from database, when adding this flag, return data in query response, it will be more high-performance.
|
Constructor and Description |
---|
DBQuery() |
Modifier and Type | Method and Description |
---|---|
int |
getFlag() |
BSONObject |
getHint() |
BSONObject |
getMatcher() |
BSONObject |
getModifier() |
BSONObject |
getOrderBy() |
Long |
getReturnRowsCount() |
BSONObject |
getSelector() |
Long |
getSkipRowsCount() |
void |
setFlag(int flag)
Set the query flag.
|
void |
setHint(BSONObject hint)
Set specified access plan.
|
void |
setMatcher(BSONObject matcher)
Set matching rule.
|
void |
setModifier(BSONObject modifier)
Set modified rule.
|
void |
setOrderBy(BSONObject orderBy)
Set ordered rule.
|
void |
setReturnRowsCount(Long returnRowsCount)
Set the count of BSONObjects to return.
|
void |
setSelector(BSONObject selector)
Set selective rule.
|
void |
setSkipRowsCount(Long skipRowsCount)
Set the count of BSONObjects to skip.
|
public static final int FLG_QUERY_FOR_UPDATE
public static final int FLG_QUERY_FORCE_HINT
public static final int FLG_QUERY_KEEP_SHARDINGKEY_IN_UPDATE
public static final int FLG_QUERY_PARALLED
public static final int FLG_QUERY_PREPARE_MORE
public static final int FLG_QUERY_STRINGOUT
public static final int FLG_QUERY_WITH_RETURNDATA
public int getFlag()
public BSONObject getHint()
public BSONObject getMatcher()
public BSONObject getModifier()
public BSONObject getOrderBy()
public Long getReturnRowsCount()
public BSONObject getSelector()
public Long getSkipRowsCount()
public void setFlag(int flag)
flag
- The query flag as follow:
public void setHint(BSONObject hint)
hint
- The specified access plan BSONObjectpublic void setMatcher(BSONObject matcher)
matcher
- The matching rule BSONObjectpublic void setModifier(BSONObject modifier)
modifier
- The modified rule BSONObjectpublic void setOrderBy(BSONObject orderBy)
orderBy
- The ordered rule BSONObjectpublic void setReturnRowsCount(Long returnRowsCount)
returnRowsCount
- The count of BSONObjects to returnpublic void setSelector(BSONObject selector)
selector
- The selective rule BSONObjectpublic void setSkipRowsCount(Long skipRowsCount)
skipRowsCount
- The count of BSONObjects to skipCopyright © 2023. All rights reserved.