用作查询@ SwayDB

2022-04-15 00:00:00 功能 专区 订阅 序列化 折扣

Conditional updates & deletes通过提交任何爪哇,斯卡拉,科特林或任何本地人JVM代码/功能。 有没有查询语言。

仅仅是JVM函数/代码,我们可以

  • Be more expressive in writing our query logic as we are not restricted by rules of a query language.
  • Use external Java libraries within our queries like Joda-Time for time management, Jackson or Circe for JSON parsing etc.
  • Write test-cases using familiar testing libraries like JUnit, kotlin.test, ScalaTest etc.
  • Type-safe - catch errors during compile time.
  • Fast - No runtime parsing & compiling performance cost. See these benchmarks that show 482,000+ writes per second. Function updates follow the same write path as any basic write and do not incur any extra cost.

Example

一个简单的示例可以创建一个Map<串, 双>那存储产品名称作为关键和价钱作为价值。 您可以使用自定义类(产品.java值),但为了简单起见串和双用来。

更新逻辑:如果产品的有效期限还不到2天,请给予50%的折扣!

  1. 相关文章