Package dev.morphia.aggregation.stages
Class Out<O>
- java.lang.Object
-
- dev.morphia.aggregation.stages.Stage
-
- dev.morphia.aggregation.stages.Out<O>
-
- Type Parameters:
O
- the output type used to lookup the collection name
public class Out<O> extends Stage
Takes the documents returned by the aggregation pipeline and writes them to a specified collection. The $out operator must be the last stage in the pipeline. The $out operator lets the aggregation framework return result sets of any size.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
Out()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
collection()
String
database()
Out<O>
database(String database)
Specifies an alternate database for the output.static <O> Out<O>
to(Class<O> type)
Creates a $out stage with target type/collectionstatic Out<Document>
to(String collection)
Creates a $out stage with target collectionClass<?>
type()
-
Methods inherited from class dev.morphia.aggregation.stages.Stage
aggregation, stageName
-
-
-
-
Method Detail
-
to
public static <O> Out<O> to(Class<O> type)
Creates a $out stage with target type/collection- Type Parameters:
O
- the output type used to lookup the collection name- Parameters:
type
- the type to use to determine the target collection- Returns:
- the new stage
-
to
public static Out<Document> to(String collection)
Creates a $out stage with target collection- Parameters:
collection
- the target collection- Returns:
- the new stage
-
collection
@MorphiaInternal public String collection()
- Returns:
- the collection name
Developer note.This is an internal item. Its function and presence are subject to change without warning. Its use is highly discouraged.
-
database
@Nullable @MorphiaInternal public String database()
- Returns:
- the database name
- Since:
- 2.3
Developer note.This is an internal item. Its function and presence are subject to change without warning. Its use is highly discouraged.
-
database
public Out<O> database(String database)
Specifies an alternate database for the output.- Parameters:
database
- the name of the database to use- Returns:
- this
- Since:
- 2.3
- Since server release
- 4.4
-
-