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
Nested ClassesModifier and TypeClassDescriptionstatic enumMeta.CursorOptionrepresentsOP_QUERYwire protocol flags to change the behavior of queries. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddFlag(Meta.CursorOption option) AddMeta.CursorOptioninfluencing behavior of theFindIterable.booleanWhen set to true, aggregation stages can write data to disk.getFlags()Returns the required comment or throwsIllegalStateExceptionif the comment is not set.Returns the required maximum time limit in milliseconds or throwsIllegalStateExceptionif the maximum time limit is not set.booleanReturn whether the comment is set.inthashCode()booleanReturn whether the maximum time limit for processing operations is set.booleanvoidsetAllowDiskUse(Boolean allowDiskUse) Enables writing to temporary files for aggregation stages and queries.voidsetComment(String comment) Add a comment to the query that is propagated to the profile log.voidsetCursorBatchSize(int cursorBatchSize) Apply the batch size (number of documents to return in each response) for a query.voidsetMaxTime(Duration timeout) Set the maximum time limit for processing operations.voidsetMaxTimeMsec(long maxTimeMsec) Set the maximum time limit in milliseconds for processing operations.values()GetIterableof 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:
trueif set;falseotherwise.- Since:
- 4.0.6
-
getMaxTimeMsec
- Returns:
- null if not set.
-
getRequiredMaxTimeMsec
Returns the required maximum time limit in milliseconds or throwsIllegalStateExceptionif 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:
trueif set;falseotherwise.- Since:
- 4.0.6
-
getComment
- Returns:
- null if not set.
-
getRequiredComment
Returns the required comment or throwsIllegalStateExceptionif 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.CursorOptioninfluencing 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_tmpsubdirectory in thedbPathdirectory.Starting in MongoDB 4.2, the profiler log messages and diagnostic log messages includes a
usedDiskindicator 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
GetIterableof set meta values.- Returns:
-
hashCode
public int hashCode() -
equals
-