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
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()inthashCode()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
-
getMaxTimeMsec
- Returns:
- null if not set.
-
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
-
setComment
Add a comment to the query that is propagated to the profile log.- Parameters:
comment-
-
getComment
- Returns:
- null if not set.
-
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
-