MONGOC_GRIDFS_...VE_BY_FILENAME(3)

okay so bestie, you’re on the libmongoc page for MONGOC_GRIDFS_...VE_BY_FILENAME(3) β€” the actual function is mongoc_gridfs_remove_by_filename. It’s giving β€œdelete every GridFS file with this name,” and honestly? iconic. 🫢

✨ SYNOPSIS ✨

          bool
          mongoc_gridfs_remove_by_filename (mongoc_gridfs_t *gridfs,
                                            const char *filename,
                                            bson_error_t *error);

πŸŽ€ PARAMETERS πŸŽ€

  • gridfs β€” a mongoc_gridfs_t. That’s your GridFS handle, bestie.
  • filename β€” a UTF-8 encoded string containing the filename. Keep it UTF-8, okay?
  • error β€” an optional location for a bson_error_t or NULL. If you don’t need the error tea, NULL is there.

πŸ¦‹ DESCRIPTION πŸ¦‹

This one removes all files matching filename β€” and their data chunks too β€” from the MongoDB server. Not a little sample, not one file: every match plus all the chunk data, periodt. πŸ’…

🌸 RETURNS 🌸

Returns true if successful, including when no files match (empty result is still valid, no cap). Returns false and sets error if there are invalid arguments or a server or network error. 😭

πŸ”₯ ERRORS πŸ”₯

Errors are propagated via the error parameter. That’s the whole flow.

πŸ‘‘ AUTHOR πŸ‘‘

MongoDB, Inc

2009-present, MongoDB, Inc.

okay bye bestie πŸ’– β€” libmongoc version 2.5.6, dated Oct 09, 202 (the footer is clipped exactly like that in the source; I’m not out here inventing digits). byeee ✨

πŸ“¦ where this page comes from