Add from, range, filter functions to QueryBuilder
Signed-off-by: davidarendsen <davidarendsen@hey.com>
This commit is contained in:
parent
b2d1bd403c
commit
34845d68a1
5 changed files with 164 additions and 23 deletions
|
|
@ -9,12 +9,11 @@ final class FilterFunctionTest extends TestCase {
|
|||
|
||||
public function testSimpleFilter()
|
||||
{
|
||||
$expression = new Filter([
|
||||
KeyValue::set('_measurement', 'test_measurement')
|
||||
->and('_field', 'user')
|
||||
->or('_field', 'field2')
|
||||
->and('user', 'my_username'),
|
||||
]);
|
||||
$expression = new Filter(KeyValue::set('_measurement', 'test_measurement')
|
||||
->and('_field', 'user')
|
||||
->or('_field', 'field2')
|
||||
->and('user', 'my_username')
|
||||
);
|
||||
|
||||
$query = '|> filter(fn: (r) => r._measurement == "test_measurement" and r._field == "user" or ' .
|
||||
'r._field == "field2" and r.user == "my_username") ';
|
||||
|
|
|
|||
Loading…
Add table
editor.link_modal.header
Reference in a new issue