Showing content from https://couchbase.github.io/couchbase-lite-core/C/html/group___doc_enumerator.html below:
LiteCore: Document Enumeration
void c4enum_close (C4DocEnumerator *e) Closes an enumeration.
NODISCARD CBL_CORE_API C4DocEnumerator * c4db_enumerateChanges (C4Database *database, C4SequenceNumber since, const C4EnumeratorOptions *options, C4Error *outError) Creates an enumerator ordered by sequence.
NODISCARD CBL_CORE_API C4DocEnumerator * c4db_enumerateAllDocs (C4Database *database, const C4EnumeratorOptions *options, C4Error *outError) Creates an enumerator ordered by docID.
NODISCARD CBL_CORE_API C4DocEnumerator * c4coll_enumerateChanges (C4Collection *collection, C4SequenceNumber since, const C4EnumeratorOptions *options, C4Error *outError) Creates an enumerator ordered by sequence.
NODISCARD CBL_CORE_API C4DocEnumerator * c4coll_enumerateAllDocs (C4Collection *collection, const C4EnumeratorOptions *options, C4Error *outError) Creates an enumerator ordered by docID.
NODISCARD CBL_CORE_API bool c4enum_next (C4DocEnumerator *e, C4Error *outError) Advances the enumerator to the next document.
NODISCARD CBL_CORE_API C4Document * c4enum_getDocument (C4DocEnumerator *e, C4Error *outError) Returns the current document, if any, from an enumerator.
CBL_CORE_API bool c4enum_getDocumentInfo (C4DocEnumerator *e, C4DocumentInfo *outInfo) Stores the metadata of the enumerator's current document into the supplied C4DocumentInfo struct.
◆ C4EnumeratorFlags Enumerator kC4Descending
If true, iteration goes by descending document IDs.
kC4Unsorted
If true, iteration order is undefined (may be faster!)
kC4IncludeDeleted
If true, include deleted documents.
kC4IncludeNonConflicted
If false, include only documents in conflict.
kC4IncludeBodies kC4IncludeRevHistory
If false, document bodies will not be preloaded, just metadata (docID, revID, sequence, flags.) This is faster if you don't need to access the revision tree or revision bodies.
You can still access all the data of the document, but it will trigger loading the document body from the database. Put entire revision history/version vector in revID
◆ c4coll_enumerateAllDocs()
Creates an enumerator ordered by docID.
Options have the same meanings as in Couchbase Lite. There's no 'limit' option; just stop enumerating when you're done. Caller is responsible for freeing the enumerator when finished with it.
-
Note
-
The caller must use a lock for Database when this function is called.
-
Parameters
-
collection The collection. options Enumeration options (NULL for defaults). outError Error will be stored here on failure.
-
Returns
-
A new enumerator, or NULL on failure.
◆ c4coll_enumerateChanges()
Creates an enumerator ordered by sequence.
Caller is responsible for freeing the enumerator when finished with it.
-
Note
-
The caller must use a lock for Database when this function is called.
-
Parameters
-
collection The collection. since The sequence number to start after. Pass 0 to start from the beginning. options Enumeration options (NULL for defaults). outError Error will be stored here on failure.
-
Returns
-
A new enumerator, or NULL on failure.
◆ c4db_enumerateAllDocs()
Creates an enumerator ordered by docID.
Options have the same meanings as in Couchbase Lite. There's no 'limit' option; just stop enumerating when you're done. Caller is responsible for freeing the enumerator when finished with it.
-
Note
-
The caller must use a lock for Database when this function is called.
-
Parameters
-
database The database. options Enumeration options (NULL for defaults). outError Error will be stored here on failure.
-
Returns
-
A new enumerator, or NULL on failure.
◆ c4db_enumerateChanges()
Creates an enumerator ordered by sequence.
Caller is responsible for freeing the enumerator when finished with it.
-
Note
-
The caller must use a lock for Database when this function is called.
-
Parameters
-
database The database. since The sequence number to start after. Pass 0 to start from the beginning. options Enumeration options (NULL for defaults). outError Error will be stored here on failure.
-
Returns
-
A new enumerator, or NULL on failure.
◆ c4enum_close()
Closes an enumeration.
This is optional, but can be used to free up resources if the enumeration has not reached its end, but will not be freed for a while.
-
Note
-
The caller must use a lock for DocEnumerator when this function is called.
◆ c4enum_getDocument()
Returns the current document, if any, from an enumerator.
-
Note
-
The caller must use a lock for DocEnumerator when this function is called.
-
Parameters
-
e The enumerator. outError Error will be stored here on failure.
-
Returns
-
The document, or NULL if there is none or if an error occurred reading its body. Caller is responsible for calling c4doc_release() when done with it.
◆ c4enum_getDocumentInfo()
Stores the metadata of the enumerator's current document into the supplied C4DocumentInfo struct.
Unlike c4enum_getDocument(), this allocates no memory.
-
Note
-
The caller must use a lock for DocEnumerator when this function is called.
-
Parameters
-
e The enumerator. outInfo A pointer to a C4DocumentInfo struct that will be filled in if a document is found.
-
Returns
-
True if the info was stored, false if there is no current document.
◆ c4enum_next()
Advances the enumerator to the next document.
Returns false at the end, or on error; look at the C4Error to determine which occurred, and don't forget to free the enumerator.
-
Note
-
The caller must use a lock for DocEnumerator when this function is called.
◆ kC4DefaultEnumeratorOptions
Default all-docs enumeration options.
(Equal to kC4IncludeNonConflicted | kC4IncludeBodies)
RetroSearch is an open source project built by @garambo
| Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4