MONGOC_URI_SET_COMPRESSORS(3)
π MONGOC_URI_SET_COMPRESSORS π
okay so bestie, we're in libmongoc land and today's main character is mongoc_uri_set_compressors β the little function that decides which compressors your URI is gonna flex with. iykyk π«Ά
β¨ SYNOPSIS β¨
bool
mongoc_uri_set_compressors (mongoc_uri_t *uri, const char *compressors);
π PARAMETERS π
uriβ amongoc_uri_t. your uri. the one getting a glow-up πcompressorsβ a string with one or more compressor names separated by commas (,) β for example"snappy,zlib"β orNULL. and here's the tea: passingNULLor an empty string clears any compressors already set onuri. poof, gone, no cap π«§
πΈ DESCRIPTION πΈ
so this sets the URI's compressors after the URI has already been parsed from a string. the way it just overwrites any previously set value? iconic. previous value could never π
π¦ EXAMPLE π¦
mongoc_client_t *client;
mongoc_uri_t *uri;
uri = mongoc_uri_new ("mongodb://localhost/");
mongoc_uri_set_compressors (uri, "snappy,zlib,zstd");
mongoc_client_new_from_uri (uri);
/* Snappy & zlib & zstd compressors are enabled */
look at that. Snappy & zlib & zstd all enabled, all living their best life β¨
β RETURNS β
returns false if the option can't be set β like, for example, if compressors isn't valid UTF-8 π. and heads up: it logs a warning to stderr with the MONGOC_WARNING macro if compressor is not available.
ngl if you see that warning, your compressor just wasn't in the building π
π AUTHOR π
MongoDB, Inc
π COPYRIGHT π
2009-present, MongoDB, Inc.
and that's the whole vibe, bestie β this was libmongoc 2.5.6, dated Oct 09, 2026, signing off with love π«Άπβ¨
π¦ 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