Loading...
Searching...
No Matches
mongocxx::v1::pipeline Class Reference

`#include <mongocxx/v1/pipeline.hpp>`

## Description

A MongoDB aggregation pipeline.

See also
  - Aggregation Operations (MongoDB Manual)

## Public Member Functions

| pipeline ()
| Default initialization.
| pipeline (pipeline &&other) noexcept
| Move constructor.
| pipeline (pipeline const &other)
| Copy constructor.
| ~pipeline ()
| Destroy this object.
pipeline & | add_fields (bsoncxx::v1::document::view v)
| Append the "$addFields" stage.
pipeline & | append_stage (bsoncxx::v1::document::view v)
| Append the given aggregation stage.
pipeline & | append_stages (bsoncxx::v1::array::view v)
| Append an array of aggregation stages.
pipeline & | bucket (bsoncxx::v1::document::view v)
| Append the "$bucket" stage.
pipeline & | bucket_auto (bsoncxx::v1::document::view v)
| Append the "$bucketAuto" stage.
pipeline & | coll_stats ()
| Append the "$collStats" stage with an empty document.
pipeline & | coll_stats (bsoncxx::v1::document::view v)
| Append the "$collStats" stage.
pipeline & | count (bsoncxx::v1::stdx::string_view v)
| Append the "$count" stage.
pipeline & | current_op (bsoncxx::v1::document::view v)
| Append the "$currentOp" stage.
pipeline & | facet (bsoncxx::v1::document::view v)
| Append the "$facet" stage.
pipeline & | geo_near (bsoncxx::v1::document::view v)
| Append the "$geoNear" stage.
pipeline & | graph_lookup (bsoncxx::v1::document::view v)
| Append the "$graphLookup" stage.
pipeline & | group (bsoncxx::v1::document::view v)
| Append the "$group" stage.
pipeline & | index_stats ()
| Append the "$indexStats" stage.
pipeline & | list_local_sessions (bsoncxx::v1::document::view v)
| Append the "$listLocalSessions" stage.
pipeline & | list_sessions (bsoncxx::v1::document::view v)
| Append the "$listSessions" stage.
pipeline & | lookup (bsoncxx::v1::document::view v)
| Append the "$lookup" stage.
pipeline & | match (bsoncxx::v1::document::view v)
| Append the "$match" stage.
pipeline & | merge (bsoncxx::v1::document::view v)
| Append the "$merge" stage.
pipeline & | operator= (pipeline &&other) noexcept
| Move assignment.
pipeline & | operator= (pipeline const &other)
| Copy assignment.
pipeline & | out (bsoncxx::v1::stdx::string_view v)
| Append the "$out" stage.
pipeline & | project (bsoncxx::v1::document::view v)
| Append the "$project" stage.
pipeline & | redact (bsoncxx::v1::document::view v)
| Append the "$redact" stage.
pipeline & | replace_root (bsoncxx::v1::document::view v)
| Append the "$replaceRoot" stage.
pipeline & | sample (std::int32_t v)
| Append the "$sample" stage.
pipeline & | sort (bsoncxx::v1::document::view v)
| Append the "$sort" stage.
pipeline & | sort_by_count (bsoncxx::v1::document::view v)
| Append the "$sortByCount" stage.
pipeline & | sort_by_count (bsoncxx::v1::stdx::string_view v)
| Append the "$sortByCount" stage.
pipeline & | unwind (bsoncxx::v1::document::view v)
| Append the "$unwind" stage.
pipeline & | unwind (bsoncxx::v1::stdx::string_view v)
| Append the "$unwind" stage.
bsoncxx::v1::array::view | view_array () const
| Return the current array of aggregation stages.
pipeline & | limit (std::int32_t v)
| Append the "$limit" stage.
pipeline & | limit (std::int64_t v)
| Append the "$limit" stage.
pipeline & | skip (std::int32_t v)
| Append the "$skip" stage.
pipeline & | skip (std::int64_t v)
| Append the "$skip" stage.

## Constructor & Destructor Documentation

## ~pipeline()

mongocxx::v1::pipeline::~pipeline | ( |  | ) |

Destroy this object.

## pipeline() [1/3]

mongocxx::v1::pipeline::pipeline | ( | pipeline && | other | ) |

noexcept

Move constructor.

Postconditions:
  - other is in an assign-or-destroy-only state.

## pipeline() [2/3]

mongocxx::v1::pipeline::pipeline | ( | pipeline const & | other | ) |

Copy constructor.

## pipeline() [3/3]

mongocxx::v1::pipeline::pipeline | ( |  | ) |

Default initialization.

Postconditions:
  - this->view().empty() == true

## Member Function Documentation

## add_fields()

pipeline & mongocxx::v1::pipeline::add_fields | ( | bsoncxx::v1::document::view | v | ) |

Append the "$addFields" stage.

## append_stage()

pipeline & mongocxx::v1::pipeline::append_stage | ( | bsoncxx::v1::document::view | v | ) |

Append the given aggregation stage.

## append_stages()

pipeline & mongocxx::v1::pipeline::append_stages | ( | bsoncxx::v1::array::view | v | ) |

Append an array of aggregation stages.

## bucket()

pipeline & mongocxx::v1::pipeline::bucket | ( | bsoncxx::v1::document::view | v | ) |

Append the "$bucket" stage.

## bucket_auto()

pipeline & mongocxx::v1::pipeline::bucket_auto | ( | bsoncxx::v1::document::view | v | ) |

Append the "$bucketAuto" stage.

## coll_stats() [1/2]

pipeline & mongocxx::v1::pipeline::coll_stats | ( |  | ) |

Append the "$collStats" stage with an empty document.

## coll_stats() [2/2]

pipeline & mongocxx::v1::pipeline::coll_stats | ( | bsoncxx::v1::document::view | v | ) |

Append the "$collStats" stage.

## count()

pipeline & mongocxx::v1::pipeline::count | ( | bsoncxx::v1::stdx::string_view | v | ) |

Append the "$count" stage.

## current_op()

pipeline & mongocxx::v1::pipeline::current_op | ( | bsoncxx::v1::document::view | v | ) |

Append the "$currentOp" stage.

## facet()

pipeline & mongocxx::v1::pipeline::facet | ( | bsoncxx::v1::document::view | v | ) |

Append the "$facet" stage.

## geo_near()

pipeline & mongocxx::v1::pipeline::geo_near | ( | bsoncxx::v1::document::view | v | ) |

Append the "$geoNear" stage.

## graph_lookup()

pipeline & mongocxx::v1::pipeline::graph_lookup | ( | bsoncxx::v1::document::view | v | ) |

Append the "$graphLookup" stage.

## group()

pipeline & mongocxx::v1::pipeline::group | ( | bsoncxx::v1::document::view | v | ) |

Append the "$group" stage.

## index_stats()

pipeline & mongocxx::v1::pipeline::index_stats | ( |  | ) |

Append the "$indexStats" stage.

## limit() [1/2]

pipeline & mongocxx::v1::pipeline::limit | ( | std::int32_t | v | ) |

Append the "$limit" stage.

## limit() [2/2]

pipeline & mongocxx::v1::pipeline::limit | ( | std::int64_t | v | ) |

Append the "$limit" stage.

## list_local_sessions()

pipeline & mongocxx::v1::pipeline::list_local_sessions | ( | bsoncxx::v1::document::view | v | ) |

Append the "$listLocalSessions" stage.

## list_sessions()

pipeline & mongocxx::v1::pipeline::list_sessions | ( | bsoncxx::v1::document::view | v | ) |

Append the "$listSessions" stage.

## lookup()

pipeline & mongocxx::v1::pipeline::lookup | ( | bsoncxx::v1::document::view | v | ) |

Append the "$lookup" stage.

## match()

pipeline & mongocxx::v1::pipeline::match | ( | bsoncxx::v1::document::view | v | ) |

Append the "$match" stage.

## merge()

pipeline & mongocxx::v1::pipeline::merge | ( | bsoncxx::v1::document::view | v | ) |

Append the "$merge" stage.

## operator=() [1/2]

pipeline & mongocxx::v1::pipeline::operator= | ( | pipeline && | other | ) |

noexcept

Move assignment.

Postconditions:
  - other is in an assign-or-destroy-only state.

## operator=() [2/2]

pipeline & mongocxx::v1::pipeline::operator= | ( | pipeline const & | other | ) |

Copy assignment.

## out()

pipeline & mongocxx::v1::pipeline::out | ( | bsoncxx::v1::stdx::string_view | v | ) |

Append the "$out" stage.

## project()

pipeline & mongocxx::v1::pipeline::project | ( | bsoncxx::v1::document::view | v | ) |

Append the "$project" stage.

## redact()

pipeline & mongocxx::v1::pipeline::redact | ( | bsoncxx::v1::document::view | v | ) |

Append the "$redact" stage.

## replace_root()

pipeline & mongocxx::v1::pipeline::replace_root | ( | bsoncxx::v1::document::view | v | ) |

Append the "$replaceRoot" stage.

## sample()

pipeline & mongocxx::v1::pipeline::sample | ( | std::int32_t | v | ) |

Append the "$sample" stage.

## skip() [1/2]

pipeline & mongocxx::v1::pipeline::skip | ( | std::int32_t | v | ) |

Append the "$skip" stage.

## skip() [2/2]

pipeline & mongocxx::v1::pipeline::skip | ( | std::int64_t | v | ) |

Append the "$skip" stage.

## sort()

pipeline & mongocxx::v1::pipeline::sort | ( | bsoncxx::v1::document::view | v | ) |

Append the "$sort" stage.

## sort_by_count() [1/2]

pipeline & mongocxx::v1::pipeline::sort_by_count | ( | bsoncxx::v1::document::view | v | ) |

Append the "$sortByCount" stage.

## sort_by_count() [2/2]

pipeline & mongocxx::v1::pipeline::sort_by_count | ( | bsoncxx::v1::stdx::string_view | v | ) |

Append the "$sortByCount" stage.

## unwind() [1/2]

pipeline & mongocxx::v1::pipeline::unwind | ( | bsoncxx::v1::document::view | v | ) |

Append the "$unwind" stage.

## unwind() [2/2]

pipeline & mongocxx::v1::pipeline::unwind | ( | bsoncxx::v1::stdx::string_view | v | ) |

Append the "$unwind" stage.

## view_array()

bsoncxx::v1::array::view mongocxx::v1::pipeline::view_array | ( |  | ) | const

Return the current array of aggregation stages.

The documentation for this class was generated from the following file:

- mongocxx/v1/pipeline.hpp