Skip to content

Commit

Permalink
Added : Query chaining && Code refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
s4kibs4mi committed May 27, 2018
1 parent 39066db commit 0511c38
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,21 @@ Result,
]
```

- [x] Query Chaining
```kotlin
val res = jsonq.from("users").whereGe("id", 3).whereEq("location", "Barisal").contains("name", "Is")
```
Result,
```json
[
{
"id": 3,
"name": "Ariful Islam",
"location": "Barisal"
}
]
```

## TODO

- [ ] Add missing methods
Expand Down
4 changes: 1 addition & 3 deletions src/test/kotlin/ninja/sakib/jsonq/JSONQTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,7 @@ class JSONQTest {
@Test
fun QueryChain() {
val res = jsonq.from("users")
println(res.whereGe("id", 3))
println(res.whereGe("id", 3).contains("location", "Barisal"))
println(res.whereGe("id", 3).contains("name", "Is"))
println(res.whereGe("id", 3).whereEq("location", "Barisal").contains("name", "Is"))
}

@Test
Expand Down

0 comments on commit 0511c38

Please sign in to comment.