#import <Foundation/Foundation.h>
Go to the source code of this file.
|
| protocol | <CBLViewCompiler > |
| | An external object that knows how to map source code of some sort into executable functions. More...
|
| |
| class | CBLView |
| | A "view" in a CouchbaseLite database – essentially a persistent index managed by map/reduce. More...
|
| |
|
| #define | MAPBLOCK(BLOCK) ^(CBLJSONDict* doc, void (^emit)(id key, id value)){BLOCK} |
| |
| #define | REDUCEBLOCK(BLOCK) ^id(NSArray* keys, NSArray* values, BOOL rereduce){BLOCK} |
| |
|
| FOUNDATION_EXTERN id | CBLTextKey (NSString *text) |
| | Returns a special value that, when emitted as a key, causes the given text to be indexed with the full-text indexer. More...
|
| |
◆ MAPBLOCK
| #define MAPBLOCK |
( |
|
BLOCK | ) |
^(CBLJSONDict* doc, void (^emit)(id key, id value)){BLOCK} |
◆ REDUCEBLOCK
| #define REDUCEBLOCK |
( |
|
BLOCK | ) |
^id(NSArray* keys, NSArray* values, BOOL rereduce){BLOCK} |
◆ CBLMapEmitBlock
| typedef void(^ CBLMapEmitBlock) (id key, __nullable id value) |
◆ CBLMapBlock
A "map" function called when a document is to be added to a view.
- Parameters
-
| doc | The contents of the document being analyzed. |
| emit | A block to be called to add a key/value pair to the view. Your block can call it zero, one or multiple times. |
◆ CBLReduceBlock
| typedef __nonnull id(^ CBLReduceBlock) (NSArray *__nonnull keys, NSArray *__nonnull values, BOOL rereduce) |
A "reduce" function called to summarize the results of a view.
- Parameters
-
| keys | An array of keys to be reduced (or nil if this is a rereduce). |
| values | A parallel array of values to be reduced, corresponding 1::1 with the keys. |
| rereduce | YES if the input values are the results of previous reductions. |
- Returns
- The reduced value; almost always a scalar or small fixed-size object.
◆ CBLViewIndexType
| Enumerator |
|---|
| kCBLMapReduceIndex | Regular map/reduce index with JSON keys.
|
| kCBLFullTextIndex | Keys must be strings and will be indexed by the words they contain.
|
| kCBLGeoIndex | Geo-query index; not supported yet.
|
◆ CBLTextKey()
| FOUNDATION_EXTERN id CBLTextKey |
( |
NSString * |
text | ) |
|
Returns a special value that, when emitted as a key, causes the given text to be indexed with the full-text indexer.
Used inside a map block, like so: emit(CBLTextKey(longText), value);