1092valid.mql 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. SELECT id,prom.last(20d).find(name='test1').unit('count','1d') FROM /test/bucketpromdb where id='bucketpromdb:wecisen1'
  2. /**
  3. output()
  4. matchcount(id, "bucketpromdb:wecisen1", "prom.1.2", 288, 1)
  5. **/
  6. ;
  7. SELECT id,prom.date('2025-01-02').find(name='test1') FROM /test/bucketpromdb where id='bucketpromdb:wecisen1'
  8. /**
  9. output()
  10. matchcount(id, "bucketpromdb:wecisen1", "prom.len", 2880, 1)
  11. **/
  12. ;
  13. SELECT id,prom.date('2025-01-01', '2025-01-03').time('09:00:00','19:00:00').find(name='test1') FROM /test/bucketpromdb where id='bucketpromdb:wecisen1'
  14. /**
  15. output()
  16. matchcount(id, "bucketpromdb:wecisen1", "prom.len", 2400, 1)
  17. **/
  18. ;
  19. SELECT id,prom.time('2025-01-02 00:00:00', '2025-01-04 00:00:00').find(name='test1') FROM /test/bucketpromdb where id='bucketpromdb:wecisen1'
  20. /**
  21. output()
  22. matchcount(id, "bucketpromdb:wecisen1", "prom.len", 5760, 1)
  23. **/
  24. ;
  25. SELECT id,prom.date('2025-01-02').time('09:09:00','09:19:00').find(name='test1') FROM /test/bucketpromdb where id='bucketpromdb:wecisen1'
  26. /**
  27. output()
  28. matchcount(id, "bucketpromdb:wecisen1", "prom.len", 20, 1)
  29. **/
  30. ;
  31. SELECT id,prom.date('2025-01-02').time('09:09:00','10:19:00').find(name='test1') FROM /test/bucketpromdb where id='bucketpromdb:wecisen1'
  32. /**
  33. output()
  34. matchcount(id, "bucketpromdb:wecisen1", "prom.len", 140, 1)
  35. **/
  36. ;
  37. SELECT id,prom.time('2025-01-01 09:09:09.090', '2025-01-03 19:19:19.191').find(name='test1') FROM /test/bucketpromdb where id='bucketpromdb:wecisen1'
  38. /**
  39. output()
  40. matchcount(id, "bucketpromdb:wecisen1", "prom.len", 6980, 1)
  41. **/
  42. ;
  43. SELECT id,prom.count() FROM /test/bucketpromdb
  44. /**
  45. output()
  46. match(id, "bucketpromdb:wecisen1", "prom.0.2", 31680)
  47. match(id, "bucketpromdb:wecise", "prom.0.2", 63)
  48. retry(100)
  49. **/
  50. ;
  51. SELECT id,prom.limit(1).count() FROM /test/bucketpromdb
  52. /**
  53. output()
  54. match(id, "bucketpromdb:wecisen1", "prom.0.2", 1)
  55. match(id, "bucketpromdb:wecise", "prom.0.2", 1)
  56. **/
  57. ;
  58. SELECT id,prom FROM /test/bucketpromdb
  59. where prom.count().assert($1>0)
  60. /**
  61. output()
  62. count(2)
  63. match(id, "bucketpromdb:wecisen1", "prom.len", 1)
  64. match(id, "bucketpromdb:wecise", "prom.len", 1)
  65. **/
  66. ;
  67. SELECT id,prom FROM /test/bucketpromdb
  68. where prom.limit(1).count().assert($1>0)
  69. /**
  70. output()
  71. count(2)
  72. match(id, "bucketpromdb:wecisen1", "prom.len", 1)
  73. match(id, "bucketpromdb:wecise", "prom.len", 1)
  74. **/
  75. ;