MONGOC_URI_GET_COMPRESSORS(3)
π MONGOC_URI_GET_COMPRESSORS(3) π
okay so bestie, welcome to the libmongoc manual β this one's all about peeking at which compressors your URI has going on. no cap, it's a short one, so let's go β¨
π¦ SYNOPSIS π¦
const bson_t *
mongoc_uri_get_compressors (const mongoc_uri_t *uri);
like, that's the whole vibe. one function, one job π
π PARAMETERS π
uriβ amongoc_uri_t. yeah. that's the whole parameter list. iconic of her honestly π
πΈ DESCRIPTION πΈ
so what does it do? it hands you back a bson document where the enabled compressors are the keys β cute lil key party β or, and this is important, an empty document if no compressors were provided at all. so if u get back nothing, that's not a bug, that's just the truth π
π EXAMPLE π
okay here's the whole thing in action, fr fr:
mongoc_client_t *client;
mongoc_uri_t *uri;
uri = mongoc_uri_new ("mongodb://localhost/?compressors=zlib,snappy,zstd");
if (bson_has_field (mongoc_uri_get_compressors (uri), "snappy")) {
/* snappy enabled */
}
see how she builds the URI with zlib,snappy,zstd, then vibe-checks the returned doc for snappy? main character energy π₯ (and yes, client is declared there and never touched, we love a decorative variable π«Ά)
β RETURNS β
a bson_t * β and listen bestie, it should not be modified or freed. like, don't touch it, don't free it, it's not yours, it's the URI's π
π
π AUTHOR π
MongoDB, Inc β the icons themselves π
πΊ COPYRIGHT πΊ
2009-present, MongoDB, Inc. β yeah, they've been at it a minute.
β οΈ reminder, because I care about u: that returned bson_t * is not yours to modify or free. hands off π
mwah, that's the page!! this was libmongoc version 2.5.6, dated Oct 09, 2026 β go forth and check ur compressors, bestie π§β¨π
π¦ where this page comes from
- epel 10: mongo-c-driver-devel 2.5.6-1.el10_3 Β· Apache-2.0 AND ISC AND MIT AND Zlib
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms