12strulogs.mql 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. -- ============================================================
  2. -- bucket strulogs 测试
  3. -- ============================================================
  4. -- 1. 插入数据到 bucket strulogs
  5. insert into /test/aaa/test_bucket_strulogs (name, data, val) values ('strulog_001', 'structured log data 1', 100)
  6. ;
  7. -- 2. 查询 bucket strulogs
  8. select * from /test/aaa/test_bucket_strulogs where name='strulog_001'
  9. /**
  10. output()
  11. count(1)
  12. **/
  13. ;
  14. -- 3. 批量插入
  15. insert into /test/aaa/test_bucket_strulogs (name, data, val) values ('strulog_002', 'structured log data 2', 200)
  16. ;
  17. insert into /test/aaa/test_bucket_strulogs (name, data, val) values ('strulog_003', 'structured log data 3', 300)
  18. ;
  19. -- 4. 按值搜索 strulogs
  20. select * from /test/aaa/test_bucket_strulogs where val>150
  21. /**
  22. output()
  23. **/
  24. ;
  25. -- 5. update strulogs
  26. update /test/aaa/test_bucket_strulogs set val=999 where name='strulog_001'
  27. ;
  28. select name, val from /test/aaa/test_bucket_strulogs where name='strulog_001'
  29. /**
  30. output()
  31. match("val","999")
  32. **/
  33. ;
  34. -- 6. delete strulogs
  35. delete from /test/aaa/test_bucket_strulogs where name='strulog_003'
  36. ;
  37. select count(*) from /test/aaa/test_bucket_strulogs
  38. /**
  39. output()
  40. **/
  41. ;