25.authgroup.mql 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. select _group from /matrix/group
  2. /**
  3. output()
  4. **/
  5. ;
  6. update /matrix/group set _group = ? where name in ?
  7. /**
  8. params(nil, ["admin"])
  9. **/
  10. ;
  11. select _group from /matrix/group where name = 'admin' refresh
  12. /**
  13. output()
  14. matchcount(`_group`, nil, 1)
  15. **/
  16. ;
  17. update /matrix/group set _group = ? where name in ?
  18. /**
  19. params({}, ["admin"])
  20. **/
  21. ;
  22. -- cassandra update map field value {} == null
  23. select _group from /matrix/group where name = 'admin' refresh
  24. /**
  25. output()
  26. matchcount(`_group`, nil, 1)
  27. **/
  28. ;
  29. update /matrix/group set _group = _group + ? where name in ?
  30. /**
  31. params({"add": ["网络部"], "delete": ["网络部"], "edit": ["网络部"], "list": ["网络部"]}, ["admin"])
  32. **/
  33. ;
  34. select _group from /matrix/group where name = 'admin' refresh
  35. /**
  36. output()
  37. matchcount(`_group.delete.0`, "网络部", 1)
  38. **/
  39. ;
  40. update /matrix/group set _group = _group + ? where name in ?
  41. /**
  42. params({"add": ["市场部"]}, ["admin"])
  43. **/
  44. ;
  45. select _group from /matrix/group where name = 'admin' refresh
  46. /**
  47. output()
  48. matchcount(`_group.add.len`, 2, 1)
  49. **/
  50. ;