Skip to content

Commit 0511c38

Browse files
committed
Added : Query chaining && Code refactoring
1 parent 39066db commit 0511c38

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,21 @@ Result,
216216
]
217217
```
218218

219+
- [x] Query Chaining
220+
```kotlin
221+
val res = jsonq.from("users").whereGe("id", 3).whereEq("location", "Barisal").contains("name", "Is")
222+
```
223+
Result,
224+
```json
225+
[
226+
{
227+
"id": 3,
228+
"name": "Ariful Islam",
229+
"location": "Barisal"
230+
}
231+
]
232+
```
233+
219234
## TODO
220235

221236
- [ ] Add missing methods

src/test/kotlin/ninja/sakib/jsonq/JSONQTest.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,7 @@ class JSONQTest {
123123
@Test
124124
fun QueryChain() {
125125
val res = jsonq.from("users")
126-
println(res.whereGe("id", 3))
127-
println(res.whereGe("id", 3).contains("location", "Barisal"))
128-
println(res.whereGe("id", 3).contains("name", "Is"))
126+
println(res.whereGe("id", 3).whereEq("location", "Barisal").contains("name", "Is"))
129127
}
130128

131129
@Test

0 commit comments

Comments
 (0)