= lcb_flush(3couchbase) :doctype: manpage Trond Norbye NAME ---- lcb_flush - Flush a bucket SYNOPSIS -------- cc [ flag ... ] file... -lcouchbase [ library ... ] #include lcb_error_t lcb_flush(lcb_t instance, const void *command_cookie, lcb_size_t num, const lcb_flush_cmd_t *const *commands); DESCRIPTION ----------- lcb_flush() is used to perform a flush (remove all documents) on a bucket. If the library instance is using asynchronous mode (the default) this operation will return immediately and schedule the operations to be executed by the event loop, otherwise it will block until all commands are executed. command_cookie is is an opaque field that will be provided to the call‐ back function. num is the number of entries in the commands array. lcb_flush_cmd_t is a structure defined in : typedef struct lcb_flush_cmd_st { int version; /* The enty in "v" to use */ union { struct { int unused; } v0; } v; }; Upon completion the flush callback as set by lcb_set_flush_callback(3couchbase) is called. The callback is called multiple times. See lcb_set_flush_callback(3couchbase) for more information about flush callbacks. RETURN VALUES ------------- cb_flush() returns the LCB_SUCCESS on success, or a specific error code upon failure. See lcb_strerror(3couchbase) for more information. EXAMPLES -------- Example 1: Flush the bucket #include ... lcb_t instance; ... lcb_flush_cmd_t *flush = calloc(1, sizeof(*flush)); flush->version = 0; lcb_flush_cmd_t* commands[] = { flush }; lcb_flush(instance, NULL, 1, commands); ... ATTRIBUTES ---------- See lcb_attributes(5) for descriptions of the following attributes: [options="header"] |======================================= | ATTRIBUTE TYPE | ATTRIBUTE VALUE | Interface Stability | Committed | MT-Level | MT-Safe |======================================= COPYRIGHT --------- Copyright 2010-2013 Couchbase, Inc. SEE ALSO -------- Learn more at . libcouchbase(3lib), lcb_get_flush_callback(3couchbase), lcb_set_flush_callback(3couchbase), lcb_attributes(5)