@@ -193,14 +193,14 @@ You don't need to call `fetch()` method after this. Because this method will fet
193
193
Let's say you want to get the value of _ 'cities'_ property of your Json Data. You can do it like this:
194
194
195
195
``` php
196
- $q = new jsonq ('data.json');
196
+ $q = new Jsonq ('data.json');
197
197
echo $q->find('vendor.name');
198
198
```
199
199
200
200
If you want to traverse to more deep in hierarchy, you can do it like:
201
201
202
202
``` php
203
- $q = new jsonq ('data.json');
203
+ $q = new Jsonq ('data.json');
204
204
echo $q->find('vendor.name');
205
205
```
206
206
@@ -219,14 +219,14 @@ Difference between this method and `find()` is that, `find()` method will return
219
219
Let's say you want to start query over the values of _ 'vendor.name'_ property of your JSON Data. You can do it like this:
220
220
221
221
``` php
222
- $q = new jsonq ('data.json');
222
+ $q = new Jsonq ('data.json');
223
223
echo $q->from('vendor.name')->get();
224
224
```
225
225
226
226
If you want to traverse to more deep in hierarchy, you can do it like:
227
227
228
228
``` php
229
- $q = new jsonq ('data.json');
229
+ $q = new Jsonq ('data.json');
230
230
echo $q->from('users.5.visits')->get();
231
231
```
232
232
@@ -273,14 +273,14 @@ This is an alias method of `from()` and will behave exactly like that. See examp
273
273
Let's say you want to find the _ 'users'_ who has _ ` id ` _ of ` 1 ` . You can do it like this:
274
274
275
275
``` php
276
- $q = new jsonq ('data.json');
276
+ $q = new Jsonq ('data.json');
277
277
$res = $q->from('users')->where('id', '=', 1)->get();
278
278
```
279
279
280
280
You can add multiple _ where_ conditions. It'll give the result by AND-ing between these multiple where conditions.
281
281
282
282
``` php
283
- $q = new jsonq ('data.json');
283
+ $q = new Jsonq ('data.json');
284
284
$res = $q->from('users')
285
285
->where('id', '=', 1)
286
286
->where('location', '=', 'barisal')
@@ -296,7 +296,7 @@ Parameters of `orWhere()` are the same as `where()`. The only difference between
296
296
For example, if you want to find the users with _ id_ of ` 1 ` or ` 2 ` , you can do it like this:
297
297
298
298
``` php
299
- $q = new jsonq ('data.json');
299
+ $q = new Jsonq ('data.json');
300
300
$res = $q->from('users')
301
301
->where('id', '=', 1)
302
302
->orWhere('id', '=', 2)
@@ -361,7 +361,7 @@ This method will behave like `where(key, 'contains', val)` method call.
361
361
Let's say you want to find the sum of the _ 'price'_ of the _ 'products'_ . You can do it like this:
362
362
363
363
``` php
364
- $q = new jsonq ('data.json');
364
+ $q = new Jsonq ('data.json');
365
365
$res = $q->from('products')
366
366
->where('cat', '=', 1)
367
367
->sum('price');
@@ -379,7 +379,7 @@ It will return the number of elements in the collection.
379
379
Let's say you want to find how many elements are in the _ 'products'_ property. You can do it like:
380
380
381
381
``` php
382
- $q = new jsonq ('data.json');
382
+ $q = new Jsonq ('data.json');
383
383
$res = $q->from('products')
384
384
->where('cat', '=', 1)
385
385
->count();
@@ -400,7 +400,7 @@ This is an alias method of `count()`.
400
400
Let's say you want to find the maximum of the _ 'price'_ of the _ 'products'_ . You can do it like this:
401
401
402
402
``` php
403
- $q = new jsonq ('data.json');
403
+ $q = new Jsonq ('data.json');
404
404
$res = $q->from('products')
405
405
->where('cat', '=', 1)
406
406
->max('price);
@@ -418,7 +418,7 @@ See detail example [here](examples/max.php)
418
418
Let's say you want to find the minimum of the _ 'price'_ of the _ 'products'_ . You can do it like this:
419
419
420
420
``` php
421
- $q = new jsonq ('data.json');
421
+ $q = new Jsonq ('data.json');
422
422
$res = $q->from('products')
423
423
->where('cat', '=', 1)
424
424
->min('price');
@@ -436,7 +436,7 @@ See detail example [here](examples/min.php)
436
436
Let's say you want to find the average of the _ 'price'_ of the _ 'products'_ . You can do it like this:
437
437
438
438
``` php
439
- $q = new jsonq ('data.json');
439
+ $q = new Jsonq ('data.json');
440
440
$res = $q->from('products')
441
441
->where('cat', '=', 1)
442
442
->avg('price');
@@ -467,7 +467,7 @@ It will return the last element of the collection.
467
467
** example:**
468
468
469
469
``` php
470
- $q = new jsonq ('data.json');
470
+ $q = new Jsonq ('data.json');
471
471
$res = $q->from('products')
472
472
->where('cat', '=', 1)
473
473
->last();
@@ -484,7 +484,7 @@ It will return the nth element of the collection. If the given index is a **posi
484
484
** example:**
485
485
486
486
``` php
487
- $q = new jsonq ('data.json');
487
+ $q = new Jsonq ('data.json');
488
488
$res = $q->from('products')
489
489
->where('cat', '=', 1)
490
490
->nth(2);
@@ -501,7 +501,7 @@ It will return **true** if the element is not **empty** or not **null** or not a
501
501
Let's say you want to find how many elements are in the _ 'products'_ property. You can do it like:
502
502
503
503
``` php
504
- $q = new jsonq ('data.json');
504
+ $q = new Jsonq ('data.json');
505
505
$res = $q->from('products')
506
506
->where('cat', '=', 1)
507
507
->exists();
@@ -518,7 +518,7 @@ See detail example [here](examples/exists.php).
518
518
Let's say you want to group the _ 'users'_ data based on the _ 'location'_ property. You can do it like:
519
519
520
520
``` php
521
- $q = new jsonq ('data.json');
521
+ $q = new Jsonq ('data.json');
522
522
$res = $q->from('users')
523
523
->groupBy('location')
524
524
->get();
@@ -537,8 +537,8 @@ See detail example [here](examples/group-by.php).
537
537
Let's say you want to sort the _ 'arr'_ data. You can do it like:
538
538
539
539
``` php
540
- $q = new jsonq ();
541
- $res = $q->collect([7, 5, 9, 1, 3)
540
+ $q = new Jsonq ();
541
+ $res = $q->collect([7, 5, 9, 1, 3] )
542
542
->sort();
543
543
```
544
544
@@ -556,7 +556,7 @@ See detail example [here](examples/sort.php).
556
556
Let's say you want to sort the _ 'price'_ data of _ 'products'_ . You can do it like:
557
557
558
558
``` php
559
- $q = new jsonq ('data.json');
559
+ $q = new Jsonq ('data.json');
560
560
$res = $q->from('products')
561
561
->where('cat', '=', 1)
562
562
->sortBy('price', 'desc');
0 commit comments