rex_firebase_itemfilter
Plugin, ACE table, Discussion thread
Dependence: rex_firebase_apiV3
Dependence: rex_firebase_apiV3
Introduction
Query itemIDs with condition filters.
Query itemIDs with condition filters.
Usage
Sample capx, sample capx v3
Sample capx, sample capx v3
Concept
Each property (i.e. key) of a item is stored individually in firebase for querying with comparison and SET operations. For example, pick itemID by
Each property (i.e. key) of a item is stored individually in firebase for querying with comparison and SET operations. For example, pick itemID by
AND( Greater(KeyA, 10) , Equal(KeyB. 3) )
Save a item
Steps of saving are very similar with rex_firebase_itemtable.
Prepare saved values
Prepare saved values in key-value pairs by these actions
Steps of saving are very similar with rex_firebase_itemtable.
Prepare saved values
Prepare saved values in key-value pairs by these actions
- Action:Set value
- Action:Set boolean value
- Action:Remove key
Save item
After prepared, call "Action:Update" to update the specific item.
"Condition:On save complete" will be triggered if save completed, otherwise "Condition:On save error" will be triggered.
After prepared, call "Action:Update" to update the specific item.
"Condition:On save complete" will be triggered if save completed, otherwise "Condition:On save error" will be triggered.
Query items
There are two kinds of querying -
There are two kinds of querying -
- Querying with condition
- Querying with random
Querying with condition
Call "Action:Get items by condition" to get itemIDs with condition. Condition is composed of - comparison operations, and set operations in expression put at input parameter.
Call "Action:Get items by condition" to get itemIDs with condition. Condition is composed of - comparison operations, and set operations in expression put at input parameter.
Comparison operations
This plugins supports five comparison operations - Equal, Greater, Less, GreateEqual, LessEqual, InRange. To pick itemIDs which are matched these comparison condtion.
This plugins supports five comparison operations - Equal, Greater, Less, GreateEqual, LessEqual, InRange. To pick itemIDs which are matched these comparison condtion.
- Equal( Key, value )
- Greater( Key, value )
- Less( Key, value )
- GreateEqual( Key, value )
- LessEqual( Key, value )
- InRange( Key, start, end )
Set operations
This plugin supports three set operations - OR, AND, SUB.
This plugin supports three set operations - OR, AND, SUB.
- OR( condition0, condition1, ...) : (result of condition0) OR (result of condition1) OR ....
- AND( condition0, condition1, ...) : (result of condition0) AND (result of condition1) AND ....
- SUB( condition0, condition1, ...) : (result of condition0) - (result of condition1) - ....
Get result
"Condition:On request complete" will be triggered when get querying result. User could use "Condition:For each itemID" to retrieve these itemIDs, or export result in JSON string by "Expression:ItemIDToJSON".
"Condition:On request complete" will be triggered when get querying result. User could use "Condition:For each itemID" to retrieve these itemIDs, or export result in JSON string by "Expression:ItemIDToJSON".
Since
firebase only could pick itemIDs with single condition, this plugin will picking itemIDs with each comparison condition, then do set operations to get the final result. So that it might invoke more than one querying to server.
Querying with random
Call "Action:Get random items" to get random itemIDs.
Others are the same as Querying with condition at previous section.
Call "Action:Get random items" to get random itemIDs.
Others are the same as Querying with condition at previous section.
Since firebase does not support picking randomly in server side, this plugin will fetch all itemIDs from server, then picking random itemID in client side.
Querying with single condition
These actions could get itemIDs with a limited count in a single condition -
These actions could get itemIDs with a limited count in a single condition -
- Action:Get items by comparison - only supports "Equal to", "Greater than or Equal to", "Less than or Equal to"
- Action:Get items by "In Range"
These actions have minimal data transfer since it limits the count of itemID.
Remove a item
Call "Action:Remove" to remove a item.
"Condition:On remove complete" will be triggered if save completed, otherwise "Condition:On remove error" will be triggered.
Call "Action:Remove" to remove a item.
"Condition:On remove complete" will be triggered if save completed, otherwise "Condition:On remove error" will be triggered.
Load items
This plugin is designed only for querying, it does not support loading items. Using rex_firebase_itemtable to save and load whole properties of items.
On the other word, using this plugin to get matched itemIDs, then get content of these itemIDs by rex_firebase_itemtable.
This plugin is designed only for querying, it does not support loading items. Using rex_firebase_itemtable to save and load whole properties of items.
On the other word, using this plugin to get matched itemIDs, then get content of these itemIDs by rex_firebase_itemtable.