Class Meta
java.lang.Object
org.springframework.data.mongodb.core.query.Meta
Meta-data for
Query
instances.- Since:
- 1.6
- Author:
- Christoph Strobl, Oliver Gierke, Mark Paluch
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Meta.CursorOption
representsOP_QUERY
wire protocol flags to change the behavior of queries. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
addFlag
(Meta.CursorOption option) AddMeta.CursorOption
influencing behavior of theFindIterable
.boolean
When set to true, aggregation stages can write data to disk.getFlags()
Returns the required comment or throwsIllegalStateException
if the comment is not set.Returns the required maximum time limit in milliseconds or throwsIllegalStateException
if the maximum time limit is not set.boolean
Return whether the comment is set.int
hashCode()
boolean
Return whether the maximum time limit for processing operations is set.boolean
void
setAllowDiskUse
(Boolean allowDiskUse) Enables writing to temporary files for aggregation stages and queries.void
setComment
(String comment) Add a comment to the query that is propagated to the profile log.void
setCursorBatchSize
(int cursorBatchSize) Apply the batch size (number of documents to return in each response) for a query.void
setMaxTime
(Duration timeout) Set the maximum time limit for processing operations.void
setMaxTimeMsec
(long maxTimeMsec) Set the maximum time limit in milliseconds for processing operations.values()
GetIterable
of set meta values.
-
Constructor Details
-
Meta
public Meta()
-
-
Method Details
-
hasMaxTime
public boolean hasMaxTime()Return whether the maximum time limit for processing operations is set.- Returns:
true
if set;false
otherwise.- Since:
- 4.0.6
-
getMaxTimeMsec
- Returns:
- null if not set.
-
getRequiredMaxTimeMsec
Returns the required maximum time limit in milliseconds or throwsIllegalStateException
if the maximum time limit is not set.- Returns:
- the maximum time limit in milliseconds for processing operations.
- Throws:
IllegalStateException
- if the maximum time limit is not set- Since:
- 4.0.6
- See Also:
-
setMaxTimeMsec
public void setMaxTimeMsec(long maxTimeMsec) Set the maximum time limit in milliseconds for processing operations.- Parameters:
maxTimeMsec
-
-
setMaxTime
Set the maximum time limit for processing operations.- Parameters:
timeout
- must not be null.- Since:
- 2.1
-
hasComment
public boolean hasComment()Return whether the comment is set.- Returns:
true
if set;false
otherwise.- Since:
- 4.0.6
-
getComment
- Returns:
- null if not set.
-
getRequiredComment
Returns the required comment or throwsIllegalStateException
if the comment is not set.- Returns:
- the comment.
- Throws:
IllegalStateException
- if the comment is not set- Since:
- 4.0.6
- See Also:
-
setComment
Add a comment to the query that is propagated to the profile log.- Parameters:
comment
-
-
getCursorBatchSize
- Returns:
- null if not set.
- Since:
- 2.1
-
setCursorBatchSize
public void setCursorBatchSize(int cursorBatchSize) Apply the batch size (number of documents to return in each response) for a query.
Use 0 (zero) for no limit. A negative limit closes the cursor after returning a single batch indicating to the server that the client will not ask for a subsequent one.- Parameters:
cursorBatchSize
- The number of documents to return per batch.- Since:
- 2.1
-
addFlag
AddMeta.CursorOption
influencing behavior of theFindIterable
.- Parameters:
option
- must not be null.- Returns:
- Since:
- 1.10
-
getFlags
- Returns:
- never null.
- Since:
- 1.10
-
getAllowDiskUse
When set to true, aggregation stages can write data to disk.- Returns:
- null if not set.
- Since:
- 3.0
-
setAllowDiskUse
Enables writing to temporary files for aggregation stages and queries. When set to true, aggregation stages can write data to the_tmp
subdirectory in thedbPath
directory.Starting in MongoDB 4.2, the profiler log messages and diagnostic log messages includes a
usedDisk
indicator if any aggregation stage wrote data to temporary files due to memory restrictions.- Parameters:
allowDiskUse
- use null for server defaults.- Since:
- 3.0
-
hasValues
public boolean hasValues()- Returns:
-
values
GetIterable
of set meta values.- Returns:
-
hashCode
public int hashCode() -
equals
-