class QueryOpBuilder
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private boolean |
explain |
private DBObject |
hintObj |
private java.lang.String |
hintStr |
private long |
maxTimeMS |
private DBObject |
orderBy |
private DBObject |
query |
(package private) static java.lang.String |
READ_PREFERENCE_META_OPERATOR |
private ReadPreference |
readPref |
private boolean |
snapshot |
private DBObject |
specialFields |
| Constructor and Description |
|---|
QueryOpBuilder() |
| Modifier and Type | Method and Description |
|---|---|
QueryOpBuilder |
addExplain(boolean explain)
Adds the explain flag to the operation
|
QueryOpBuilder |
addHint(DBObject hint)
Adds hint clause to the operation
|
QueryOpBuilder |
addHint(java.lang.String hint)
Adds the hint clause to the operation
|
QueryOpBuilder |
addMaxTimeMS(long maxTimeMS) |
QueryOpBuilder |
addOrderBy(DBObject orderBy)
Adds the orderby clause to the operation
|
QueryOpBuilder |
addQuery(DBObject query)
Adds the query clause to the operation
|
QueryOpBuilder |
addReadPreference(ReadPreference readPref)
Adds a read preference to the query operation
|
QueryOpBuilder |
addSnapshot(boolean snapshot)
Adds the snapshot flag to the operation
|
QueryOpBuilder |
addSpecialFields(DBObject specialFields)
Adds special fields to the operation
|
private void |
addToQueryObject(DBObject dbobj,
java.lang.String field,
DBObject obj,
boolean sendEmpty)
Adds DBObject to the operation
|
private void |
addToQueryObject(DBObject dbobj,
java.lang.String field,
java.lang.Object obj)
Adds an Object to the operation
|
DBObject |
get()
Constructs the query operation DBObject
|
private boolean |
hasSpecialQueryFields() |
static final java.lang.String READ_PREFERENCE_META_OPERATOR
private DBObject query
private DBObject orderBy
private DBObject hintObj
private java.lang.String hintStr
private boolean explain
private boolean snapshot
private long maxTimeMS
private ReadPreference readPref
private DBObject specialFields
public QueryOpBuilder addQuery(DBObject query)
query - public QueryOpBuilder addOrderBy(DBObject orderBy)
orderBy - public QueryOpBuilder addHint(java.lang.String hint)
hint - public QueryOpBuilder addHint(DBObject hint)
hint - public QueryOpBuilder addSpecialFields(DBObject specialFields)
specialFields - public QueryOpBuilder addExplain(boolean explain)
explain - public QueryOpBuilder addSnapshot(boolean snapshot)
snapshot - public QueryOpBuilder addReadPreference(ReadPreference readPref)
readPref - the read preferencepublic QueryOpBuilder addMaxTimeMS(long maxTimeMS)
public DBObject get()
private boolean hasSpecialQueryFields()
private void addToQueryObject(DBObject dbobj, java.lang.String field, DBObject obj, boolean sendEmpty)
dbobj - DBObject to add field tofield - name of the fieldobj - object to add to the operation. Ignore if null.sendEmpty - if true adds obj even if it's empty. Ignore if false and obj is empty.private void addToQueryObject(DBObject dbobj, java.lang.String field, java.lang.Object obj)
dbobj - DBObject to add field tofield - name of the fieldobj - Object to be added. Ignore if null