6 #ifndef KNOWROB_MONGO_COLLECTION_H
7 #define KNOWROB_MONGO_COLLECTION_H
27 std::string_view databaseName,
28 std::string_view collectionName);
48 auto pool() {
return connection_->pool_; }
58 auto client()
const {
return client_; }
63 auto coll() {
return coll_; }
68 const auto &
name()
const {
return name_; }
73 const auto &
dbName()
const {
return dbName_; }
78 const auto &
dbURI()
const {
return connection_->uri_string_; }
158 std::shared_ptr<Connection> connection_;
159 mongoc_client_t *client_;
160 mongoc_client_session_t *session_;
161 mongoc_collection_t *coll_;
162 mongoc_database_t *db_;
166 void remove(
const Document &document, mongoc_remove_flags_t flag);
168 void createIndex_internal(
const bson_t &keys);
const auto & dbName() const
void createAscendingIndex(const std::vector< const char * > &keys)
void createIndex(const std::vector< IndexKey > &keys)
void removeOne(const bson_oid_t &oid)
void update(const Document &query, const Document &update, bool upsert=false)
void removeAll(const Document &document)
void update(const Document &query, const Document &update, bool upsert=false)
std::shared_ptr< BulkOperation > createBulkOperation()
std::vector< std::string > distinctValues(std::string_view key)
const auto & dbURI() const
void storeOne(const Document &document)
Collection(const Collection &collection)
void evalAggregation(const bson_t *pipeline)
void removeOne(const Document &document)
void appendSession(bson_t *opts)
Collection(const std::shared_ptr< Connection > &connection, std::string_view databaseName, std::string_view collectionName)
mongoc_client_session_t * session()
const auto & name() const