WCQuery

@interface WCQuery : NSObject

A WCQuery object sorts and filters data at a Webcom location.

Can order and restrict data to a smallest subset.

Queries can be chained easily with filter functions. They return WCQuery objects.

  • ref

    The query reference for the location that generated this query.

    Declaration

    Objective-C

    @property (readonly, nonatomic) WCQuery *_Nonnull ref;
  • The identifier of the query containing query criteria.

    Declaration

    Objective-C

    @property (readonly, nonatomic) NSString *_Nonnull queryIdentifier;
  • The serialized query object.

    Declaration

    Objective-C

    @property (readonly, nonatomic) NSDictionary *_Nonnull queryObject;
  • Observes data changes only once at current Webcom reference location.

    Declaration

    Objective-C

    - (void)onceEventType:(WCEventType)type
             withCallback:(nonnull void (^)(WCDataSnapshot *_Nullable,
                                            NSString *_Nullable))callback;

    Parameters

    type

    The type of event to be observed.

    callback

    A block called when the observed event occurs.

  • Observes data changes only once at current Webcom reference location.

    Declaration

    Objective-C

    - (void)onceEventType:(WCEventType)type
             withCallback:(nonnull void (^)(WCDataSnapshot *_Nullable,
                                            NSString *_Nullable))callback
        andCancelCallback:(nullable void (^)(NSError *_Nullable))cancelCallback;

    Parameters

    type

    The type of event to be observed.

    callback

    A block called when the observed event occurs.

    cancelCallback

    A block called when the user loses read permission at this location.

  • Observes data changes at current Webcom reference location.

    Declaration

    Objective-C

    - (void)onEventType:(WCEventType)type
           withCallback:(nonnull void (^)(WCDataSnapshot *_Nullable,
                                          NSString *_Nullable))callback;

    Parameters

    type

    The type of event to be observed.

    callback

    A block called when the observed event occurs.

  • Observes data changes at current Webcom reference location.

    Declaration

    Objective-C

    - (void)onEventType:(WCEventType)type
             withCallback:(nonnull void (^)(WCDataSnapshot *_Nullable,
                                            NSString *_Nullable))callback
        andCancelCallback:(nullable void (^)(NSError *_Nullable))cancelCallback;

    Parameters

    type

    The type of event to be observed.

    callback

    A block called when the observed event occurs.

    cancelCallback

    A block called when the user loses read permission at this location.

  • Removes observers for data changes at current Webcom reference location.

    Declaration

    Objective-C

    - (void)offEventType:(WCEventType)type;