-
Notifications
You must be signed in to change notification settings - Fork 9
/
curl.html
4057 lines (3642 loc) · 140 KB
/
curl.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en">
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<head>
<meta charset="utf-8" />
<title>CloudBoost SDK Reference</title>
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
<link rel="stylesheet" type="text/css" href="assets/css/site.css" media="screen" />
<script src="assets/js/qframe.js"></script>
<script src="assets/js/jquery.js"></script>
<script src="assets/js/jquery.cookie.js"></script>
<script src="assets/js/waypoints.js"></script>
<script src="assets/js/shared.js"></script>
<script src="assets/js/api.js"></script>
<!-- start Mixpanel -->
<script type="text/javascript">(function(f,b){if(!b.__SV){var a,e,i,g;window.mixpanel=b;b._i=[];b.init=function(a,e,d){function f(b,h){var a=h.split(".");2==a.length&&(b=b[a[0]],h=a[1]);b[h]=function(){b.push([h].concat(Array.prototype.slice.call(arguments,0)))}}var c=b;"undefined"!==typeof d?c=b[d]=[]:d="mixpanel";c.people=c.people||[];c.toString=function(b){var a="mixpanel";"mixpanel"!==d&&(a+="."+d);b||(a+=" (stub)");return a};c.people.toString=function(){return c.toString(1)+".people (stub)"};i="disable track track_pageview track_links track_forms register register_once alias unregister identify name_tag set_config people.set people.set_once people.increment people.append people.union people.track_charge people.clear_charges people.delete_user".split(" ");
for(g=0;g<i.length;g++)f(c,i[g]);b._i.push([a,e,d])};b.__SV=1.2;a=f.createElement("script");a.type="text/javascript";a.async=!0;a.src="undefined"!==typeof MIXPANEL_CUSTOM_LIB_URL?MIXPANEL_CUSTOM_LIB_URL:"//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js";e=f.getElementsByTagName("script")[0];e.parentNode.insertBefore(a,e)}})(document,window.mixpanel||[]);
mixpanel.init("be05a4d590e8bc9d5f2cd6b3b3ffb78b");</script>
<!-- end Mixpanel -->
</head>
<body class="api-docs node">
<div id="background"></div>
<div id="header">
<a href="https://www.cloudboost.io">
<img src="assets/images/logoc81e.png" height="40" style="float:left;margin-top:5px" />
</a>
<div class="navigation">
<div class="signin">
<a id='signin' href="https://dashboard.cloudboost.io/accounts">
<span>Sign In</span>
</a>
</div>
<ul class="global">
<li><a href="https://docs.cloudboost.io" class="selected">Documentation</a></li>
<li><a href="https://cloudboost.io/quickstart" target="_blank">Quickstart</a></li>
<li><a href="http://stackoverflow.com/questions/ask?tags=cloudboost" target="_blank">Help & Support</a></li>
</ul>
</div>
</div>
<div id="guide">
<p class="ref-title">Overview</p>
<ul class="ref-list">
<li class="section">
<a href="#Introduction" class="parent viewing">Introduction</a>
</li>
<li class="section">
<a href="#Dependencies" class="parent">Dependencies</a>
</li>
<li class="section">
<a href="#Apps" class="parent">Apps</a>
</li>
</ul>
<p class="ref-title">Classes</p>
<ul class="ref-list">
<li class="section section-charges">
<a href="#CloudObject" class="parent">Object</a>
<span class="children">
<a href="#CloudObject-save" class="parent">Save</a>
<a href="#CloudObject-fetch" class="parent">Fetch</a>
<a href="#CloudObject-delete" class="parent">Delete</a>
<a href="#CloudObject-searchable" class="parent">Index for Search</a>
<a href="#CloudObject-expires" class="parent">Expires</a>
</span>
</li>
<li class="section section-charges"><a href="#Relationships" class="parent">Relationships</a>
<span class="children">
<a href="#Relationships-oneToOne" class="parent">One-to-One</a>
<a href="#Relationships-oneToMany" class="parent">One-to-Many</a>
<a href="#Relationships-manyToMany" class="parent">Many-to-many</a>
</span>
</li>
<li class="section section-charges"><a href="#CloudQuery" class="parent">Query</a>
<span class="children">
<a href="#CloudQuery-equalTo" class="parent">Equal To</a>
<a href="#CloudQuery-containedIn" class="parent">Contained In</a>
<a href="#CloudQuery-containsAll" class="parent">Contains All</a>
<a href="#CloudQuery-startsWith" class="parent">Starts With</a>
<a href="#CloudQuery-notEqualTo" class="parent">Not Equal To</a>
<a href="#CloudQuery-notContainedIn" class="parent">Not Contained In</a>
<a href="#CloudQuery-greaterThan" class="parent">Greater Than</a>
<a href="#CloudQuery-greaterThanEqualTo" class="parent">Greater Than and Equal To</a>
<a href="#CloudQuery-lessThan" class="parent">Less Than</a>
<a href="#CloudQuery-lessThanEqualTo" class="parent">Less than and equal to</a>
<a href="#CloudQuery-or" class="parent">Or</a>
<a href="#CloudQuery-orderByAsc" class="parent">Order by</a>
<a href="#CloudQuery-setLimit" class="parent">Limit</a>
<a href="#CloudQuery-setSkip" class="parent">Skip</a>
<a href="#CloudQuery-selectColumn" class="parent">Select Column</a>
<a href="#CloudQuery-exists" class="parent">Exists</a>
<a href="#CloudQuery-doesNotExists" class="parent">Does not exist</a>
<a href="#CloudQuery-find" class="parent">Find</a>
<a href="#CloudQuery-findOne" class="parent">Find One</a>
<a href="#CloudQuery-get" class="parent">Get</a>
<a href="#CloudQuery-count" class="parent">Count</a>
<a href="#CloudQuery-distinct" class="parent">Distinct</a>
<a href="#CloudQuery-paginate" class="parent">Paginate</a>
</span>
</li>
<li class="section section-charges"><a href="#CloudSearch" class="parent">Search</a>
<span class="children">
<a href="#CloudSearch-searchOn" class="parent">Search On</a>
<a href="#CloudSearch-equalTo" class="parent">Equal To</a>
<a href="#CloudSearch-notEqualTo" class="parent">Not Equal To</a>
<a href="#CloudSearch-greaterThan" class="parent">Greater Than</a>
<a href="#CloudSearch-greaterThanEqualTo" class="parent">Greater Than and Equal To</a>
<a href="#CloudSearch-lessThan" class="parent">Less Than</a>
<a href="#CloudSearch-lessThanEqualTo" class="parent">Less than and equal to</a>
<a href="#CloudSearch-or" class="parent">OR</a>
<a href="#CloudSearch-orderByAsc" class="parent">Order by</a>
<a href="#CloudSearch-setLimit" class="parent">Limit</a>
<a href="#CloudSearch-setSkip" class="parent">Skip</a>
<a href="#CloudSearch-exists" class="parent">Exists</a>
<a href="#CloudSearch-doesNotExists" class="parent">Does not exist</a>
<a href="#CloudSearch-search" class="parent">Search</a>
</span>
</li>
<li class="section section-charges"><a href="#ACL" class="parent">ACL</a>
<span class="children">
<a href="#ACL-setPublicWriteAccess" class="parent">Public Write Access</a>
<a href="#ACL-setPublicReadAccess" class="parent">Public Read Access</a>
<a href="#ACL-setUserWriteAccess" class="parent">User Write Access</a>
<a href="#ACL-setUserReadAccess" class="parent">User Read Access</a>
<a href="#ACL-setRoleWriteAccess" class="parent">Role Write Access</a>
<a href="#ACL-setRoleReadAccess" class="parent">Role Read Access</a>
</span>
</li>
<li class="section section-charges"><a href="#CloudUser" class="parent">User</a>
<span class="children">
<a href="#CloudUser-signUp" class="parent">Signup</a>
<a href="#CloudUser-logIn" class="parent">Login</a>
<a href="#CloudUser-logOut" class="parent">Logout</a>
<a href="#CloudUser-addToRole" class="parent">Add To Role</a>
<a href="#CloudUser-removeFromRole" class="parent">Remove from Role</a>
<a href="#CloudUser-changePassword" class="parent">Change Password</a>
<a href="#CloudUser-resetPassword" class="parent">Reset Password</a>
</span>
</li>
<li class="section section-charges"><a href="#CloudRole" class="parent">Role</a>
<span class="children">
<a href="#CloudRole-getRole" class="parent">Get Role</a>
</span>
</li>
<li class="section section-charges"><a href="#CloudFile" class="parent">File</a>
<span class="children">
<a href="#CloudFile-save" class="parent">Save</a>
<a href="#CloudFile-delete" class="parent">Delete</a>
</span>
</li>
<li class="section section-charges"><a href="#Contribute" class="parent">Contribute</a>
</li>
</ul>
</div>
<!-- api docs -->
<div id="api-docs">
<a id="top" name="top" class="section-anchor"> </a>
<div id="methods">
<div class="border"></div>
<div id="language">
<a id="javascript-sdk" class="language" href="javascript.html">JavaScript</a>
<a id="curl-sdk" class="language" href="curl.html">cURL</a>
</div>
<div class="method">
<a id='Introduction' name="Introduction" class="section-anchor"> </a>
<div class="method-section">
<div class="method-description">
<h1>API Reference</h1>
<p>
The CloudBoost API is organized around <a href="http://en.wikipedia.org/wiki/Representational_State_Transfer">REST</a>.
Our API is designed to have predictable, resource-oriented URLs and to
use HTTP response codes to indicate API errors. We use built-in HTTP
features, like HTTP authentication and HTTP verbs, which can be understood
by off-the-shelf HTTP clients, and we support <a href="http://en.wikipedia.org/wiki/Cross-origin_resource_sharing">cross-origin resource sharing</a>
to allow you to interact securely with our API from a client-side web application/mobile application
(though you should remember that you should never expose your secret API master key in any public website's
client-side code, Client Key can be exposed).
<a href="http://www.json.org/">JSON</a> will be returned in all responses from the API, including errors (though if you're using API bindings/SDK,
we will convert the response to the appropriate language-specific object).
</p>
</div>
<div class="method-example" id="api-summary-example">
<h3>Endpoint</h3>
<h4></h4>
<code>https://api.cloudboost.io</code>
<br/>
</div>
</div>
</div>
<div class="method">
<a id='Dependencies' name="Dependencies" class="section-anchor"> </a>
<div class="method-section">
<div class="method-description">
<h1>Dependencies</h1>
<p>
These calls require few external dependencies.
<ul>
<li><a href="">curl-x.x.x</a></li>
</ul>
</p>
</div>
<div class="method-example" id="api-summary-example">
</div> <!-- method-example -->
</div> <!-- method-section -->
</div> <!-- method -->
<div class="method">
<a id='Apps' name="Apps" class="section-anchor"> </a>
<div class="method-section">
<div class="method-description">
<h1>Apps</h1>
<p>
In Cloudboost, you create an app each of which has its own AppID, Java
Client Key and the Master Key that you apply to your web app. You master key is a secret which should not be shared in your client apps. Your account on CloudBoost can accommodate multiple apps.
This is useful even if you have one application, since you can deploy different versions for test and production.
</p>
</div>
<div class="method-example" id="api-summary-example">
</div>
</div>
</div>
<a id='CloudObject-save' name="CloudObject-save" class="section-anchor"> </a>
<div class="method-section">
<div class="method-description">
<h3>CloudObject.save(callback)</h3>
<p>
Saves the <code>CloudObject</code> object to CloudBoost.
</p>
<div class="method-list">
<h6>Argument</h6>
<dl class="argument-list">
<dt>callback</dt>
<dd class="">Callback interface object <span>Override the done.</span></dd>
<div class="clearfix"></div>
<h6>Error Handling</h6>
<p>It throws <code>CloudBoostException</code></p>
<div class="clearfix"></div>
</dl>
</div>
</div>
<div class="method-example" id="api-summary-example">
<code class="method-request"><span class="prompt"></span><span class="lang lang-curl"><span class="highlight_js http">
curl -X PUT --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{
"key": ${client_key},
"document": { "_type": "custom",
"expires": null,
${column_name}: ${column_value},
"_modifiedColumns": ["createdAt",
"updatedAt",
"ACL",
"expires",
${column_name}],
"_tableName": "data",
"ACL": {
"write": {
"allow": {
"role": [],
"user": ["all"]
},
"deny": {
"role": [],
"user": []
}
},
"read": {
"allow": {
"role": [],
"user": ["all"]
},
"deny": {
"role": [],
"user": []
}
}
},
"_isModified": true}
}' 'http://api.cloudboost.io/data/${app_id}/${table_name}'
</span></span></span></code>
</div><!-- method-example -->
</div> <!-- method-section -->
<a id='CloudObject-fetch' name="CloudObject-fetch" class="section-anchor"> </a>
<div class="method-section">
<div class="method-description">
<h3>CloudObject.fetch()</h3>
<p>
Refreshes a <code>CloudObject</code> object to by fetching its values from the database.
</p>
<div class="method-list">
<h6>Error Handling</h6>
<p>It throws <code>CloudBoostException</code></p>
<div class="clearfix"></div>
</dl>
</div>
</div>
<div class="method-example" id="api-summary-example">
<code class="method-request"><span class="prompt"></span><span class="lang lang-node"><span class="highlight_js javascript">
curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{
"key": ${client_key},
"limit": 1,
"sort": {
},
"select": {
},
"query": {
"$includeList": [],
"$include": [],
"_id": ${id_of_object_to_fetch}
},
"skip": 0,
}' 'http://api.cloudboost.io/data/${app_id}/${table_name}/find'
</span></span></span></code>
</div><!-- method-example -->
</div> <!-- method-section -->
<a id='CloudObject-delete' name="CloudObject-delete" class="section-anchor"> </a>
<div class="method-section">
<div class="method-description">
<h3>CloudObject.delete()</h3>
<p>
Delete a <code>CloudObject</code> object, if it is saved in the database.
</p>
<div class="method-list">
<h6>Error Handling</h6>
<p>It throws <code>CloudBoostException</code></p>
</div>
</div>
<div class="method-example" id="api-summary-example">
<code class="method-request"><span class="prompt"></span><span class="lang lang-node"><span class="highlight_js javascript">
curl -X PUT --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{
"key": ${client_key},
"document": {
"updatedAt": "2016-03-15T09:22:10.446Z",
"_type": "custom",
"_version": 0,
"expires": null,
"_id": ${id_of_object_to_delete},
"createdAt": "2016-03-15T09:22:10.446Z",
"_tableName": "data",
"ACL": {
"write": {
"allow": {
"role": [],
"user": ["all"]
},
"deny": {
"role": [],
"user": []
}
},
"read": {
"allow": {
"role": [],
"user": ["all"]
},
"deny": {
"role": [],
"user": []
}
}
}
},
"method": "DELETE",
}' 'http://api.cloudboost.io/data/${app_id}/${table_name}'
</span></span></code>
</div><!-- method-example -->
</div> <!-- method-section -->
<a id='CloudObject-searchable' name="CloudObject-searchable" class="section-anchor"> </a>
<div class="method-section">
<div class="method-description">
<h3>CloudObject.isSearchable</h3>
<p>
Indexes <code>CloudObject</code> for search using CloudSearch.
</p>
</div>
<div class="method-example" id="api-summary-example">
<code class="method-request"><span class="prompt"></span><span class="lang lang-node"><span class="highlight_js javascript">
curl -X PUT --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{
"key": ${client_key},
"document": { "_type": "custom",
"expires": null,
${column_name}: ${column_value},
"_modifiedColumns": ["createdAt",
"updatedAt",
"ACL",
"expires",
${column_name}],
"_tableName": "data",
"ACL": {
"write": {
"allow": {
"role": [],
"user": ["all"]
},
"deny": {
"role": [],
"user": []
}
},
"read": {
"allow": {
"role": [],
"user": ["all"]
},
"deny": {
"role": [],
"user": []
}
}
},
"_isModified": true,
"isSearchable":true
}
}' 'http://api.cloudboost.io/data/${app_id}/${table_name}'
</span></span></span></code>
</div><!-- method-example -->
</div> <!-- method-section -->
<a id='CloudObject-expires' name="CloudObject-expires" class="section-anchor"> </a>
<div class="method-section">
<div class="method-description">
<h3>CloudObject.expires</h3>
<p>
Sets the expiration time for <code>CloudObject</code>. Expiration time is to be given as number of
milliseconds from 1 Jan 1970.
</p>
</div>
<div class="method-example" id="api-summary-example">
<code class="method-request"><span class="prompt"></span><span class="lang lang-node"><span class="highlight_js javascript">
curl -X PUT --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{
"key": ${client_key},
"document": {
"updatedAt": "2016-03-15T09:22:10.446Z",
"_type": "custom",
"_version": 0,
"expires": "2016-04-15T09:22:10.446Z",
"_id": ${id_of_object_to_delete},
"createdAt": "2016-03-15T09:22:10.446Z",
"_tableName": "data",
"ACL": {
"write": {
"allow": {
"role": [],
"user": ["all"]
},
"deny": {
"role": [],
"user": []
}
},
"read": {
"allow": {
"role": [],
"user": ["all"]
},
"deny": {
"role": [],
"user": []
}
}
}
}
}' 'http://api.cloudboost.io/data/${app_id}/${table_name}'
</span></span></span></code>
</div><!-- method-example -->
</div> <!-- method-section -->
<div class="method">
<a id='Relationships' name="Relationships" class="section-anchor"> </a>
<div class="method-section">
<div class="method-description">
<h1>Relationships</h1>
<p>
This section is dedicated to modelling relationships with CloudBoost.
</p>
<p>
There are usually three types of relationships.
<ul>
<li>
One-to-One Relationship
</li>
<li>
One-to-many Relationship
</li>
<li>
Many-to-many Relationship
</li>
</ul>
</p>
</div>
<div class="method-example" id="api-summary-example">
</div> <!-- method-example -->
</div><!-- method-section -->
<a id='Relationships-oneToOne' name="Relationships-oneToOne" class="section-anchor"> </a>
<div class="method-section">
<div class="method-description">
<h3>One-to-One Relationship</h3>
<p>
If you want to model one-to-one relationship. Then you need to create a new column of type <code> Relation </code> pointed to a table which you want it to be related to and set that column <code> Unique </code> property to true.
</p>
</div>
<div class="method-example" id="api-summary-example">
<code class="method-request"><span class="prompt"></span><span class="lang lang-node"><span class="highlight_js javascript">
curl -X PUT --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{
"key": ${client_key},
"document": {
"_type": "custom",
"expires": null,
"address": {
"_type": "custom",
"expires": null,
"StreetName": "Manhattan",
"_modifiedColumns": ["createdAt",
"updatedAt",
"ACL",
"expires",
"StreetName",
"Country"],
"_tableName": "table",
"ACL": {
"write": {
"allow": {
"role": [],
"user": ["all"]
},
"deny": {
"role": [],
"user": []
}
},
"read": {
"allow": {
"role": [],
"user": ["all"]
},
"deny": {
"role": [],
"user": []
}
}
},
"Country": "United States",
"_isModified": true
},
"name": "John Smith",
"_modifiedColumns": ["createdAt",
"updatedAt",
"ACL",
"expires",
"name",
"address"],
"_tableName": "Student",
"ACL": {
"write": {
"allow": {
"role": [],
"user": ["all"]
},
"deny": {
"role": [],
"user": []
}
},
"read": {
"allow": {
"role": [],
"user": ["all"]
},
"deny": {
"role": [],
"user": []
}
}
},
"_isModified": true
}
}' 'http://api.cloudboost.io/data/${app_id}/${table_name}'
</span></span></code>
</div><!-- method-example -->
</div> <!-- method-section -->
<a id='Relationships-oneToMany' name="Relationships-oneToMany" class="section-anchor"> </a>
<div class="method-section">
<div class="method-description">
<h3>One-to-Many Relationship</h3>
<p>
If you want to model one-to-many relationship. Then you need to create a new column of type <code> Relation </code> pointed to a table which you want it to be related to and set that column <code> Unique </code> property to false.
</p>
</div>
<div class="method-example" id="api-summary-example">
<code class="method-request"><span class="prompt"></span><span class="lang lang-node"><span class="highlight_js javascript">
curl -X PUT --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{
"key": ${client_key},
"document": {
"_type": "custom",
"expires": null,
"address": {
"_type": "custom",
"expires": null,
"StreetName": "Manhattan",
"_modifiedColumns": ["createdAt",
"updatedAt",
"ACL",
"expires",
"StreetName",
"Country"],
"_tableName": "Address",
"ACL": {
"write": {
"allow": {
"role": [],
"user": ["all"]
},
"deny": {
"role": [],
"user": []
}
},
"read": {
"allow": {
"role": [],
"user": ["all"]
},
"deny": {
"role": [],
"user": []
}
}
},
"Country": "United States",
"_isModified": true
},
"name": "John Smith",
"_modifiedColumns": ["createdAt",
"updatedAt",
"ACL",
"expires",
"name",
"address"],
"_tableName": "Student",
"ACL": {
"write": {
"allow": {
"role": [],
"user": ["all"]
},
"deny": {
"role": [],
"user": []
}
},
"read": {
"allow": {
"role": [],
"user": ["all"]
},
"deny": {
"role": [],
"user": []
}
}
},
"_isModified": true
}
}' 'http://api.cloudboost.io/data/${app_id}/${table_name}'
</span></span></code>
</div><!-- method-example -->
</div> <!-- method-section -->
<a id='Relationships-manyToMany' name="Relationships-manyToMany" class="section-anchor"> </a>
<div class="method-section">
<div class="method-description">
<h3>Many-to-Many Relationship</h3>
<p>
If you want to model many-to-many relationship. Then you have two options<br/>
<ol>
<li><b>#1 - Relation Option</b></li>
<li><b>#2 - List Option</b></li>
</ol>
We will discuss both of these options below. <br/><br/><br/>
<h4>Relation Option</h4>
<p> This option is recommended only if you have huge number of relationships assigned to any one object. </p>
<p> This relationship can be created by creating a third table and having two columns that are relatied to tables you want to have many to many relationships on. </p>
<br/><br/><br/><br/><br/><br/><br/><br/>
<h4>List Option</h4>
<p> This option is recommended only if you have small number of relationships assigned to any one object. </p>
<p> This relationship can be created by creating an array and having related objects pushed to that array and having that array saved in any column of the table. </p>
</p>
</div>
<div class="method-example" id="api-summary-example">
<code class="method-request"><span class="prompt"></span><span class="lang lang-node"><span class="highlight_js javascript">
curl -X PUT --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{
"key": ${client_key},
"document": {
"course": {
"_type": "custom",
"expires": null,
"name": "Java",
"_modifiedColumns": ["createdAt",
"updatedAt",
"ACL",
"expires",
"name"],
"_tableName": "Course",
"ACL": {
"write": {
"allow": {
"role": [],
"user": ["all"]
},
"deny": {
"role": [],
"user": []
}
},
"read": {
"allow": {
"role": [],
"user": ["all"]
},
"deny": {
"role": [],
"user": []
}
}
},
"_isModified": true
},
"_type": "custom",
"expires": null,
"student": {
"_type": "custom",
"expires": null,
"name": "John Smith",
"_modifiedColumns": ["createdAt",
"updatedAt",
"ACL",
"expires",
"name"],
"_tableName": "Student",
"ACL": {
"write": {
"allow": {
"role": [],
"user": ["all"]
},
"deny": {
"role": [],
"user": []
}
},
"read": {
"allow": {
"role": [],
"user": ["all"]
},
"deny": {
"role": [],
"user": []
}
}
},
"_isModified": true
},
"_modifiedColumns": ["createdAt",
"updatedAt",
"ACL",
"expires",
"student",
"course"],
"_tableName": "StudentCourses",
"ACL": {
"write": {
"allow": {
"role": [],
"user": ["all"]
},
"deny": {
"role": [],
"user": []
}
},
"read": {
"allow": {
"role": [],
"user": ["all"]
},
"deny": {
"role": [],
"user": []
}
}
},
"_isModified": true
}
}' 'http://api.cloudboost.io/data/${app_id}/${table_name}'
</span></span></code>
</div><!-- method-example -->
</div> <!-- method-section -->
</div>
<!-- CloudQuery Section -->
<a id='CloudQuery-equalTo' name="CloudQuery-equalTo" class="section-anchor"> </a>
<div class="method-section">
<div class="method-description">
<h3>CloudQuery.equalTo( <code>columnName, data</code> )</h3>
<p>
It adds a contriant for finding the subset of the data in which
<code>columnName</code> is equal to <code>data</code>.
</p>
<div class="method-list">
<h6>Arguments</h6>
<dl class="argument-list">
<dt>columnName</dt>
<dd class="">string <span>The column on which the contraint is to be applied</span></dd>
<div class="clearfix"></div>
<dt>data</dt>
<dd class="">Anything<span>The value of the equals contraint</span></dd>
<div class="clearfix"></div>
</dl>
<h6>Returns</h6>
<p>Same query object, which can be helpful in chaining query functions.</p>
</div>
</div>
<div class="method-example" id="api-summary-example">
<code class="method-request"><span class="prompt"></span><span class="lang lang-node"><span class="highlight_js javascript">
curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{
"key": ${client_key},
"limit": 10,
"sort": {
},
"select": {
},
"query": {
"$includeList": [],
"$include": [],
"name": "john"
},
"skip": 0
}' 'http://api.cloudboost.io/data/${app_id}/${table_name}/find'
</span></span></code>
</div><!-- method-example -->
</div> <!-- method-section -->
<a id='CloudQuery-containedIn' name="CloudQuery-containedIn" class="section-anchor"> </a>
<div class="method-section">
<div class="method-description">
<h3>CloudQuery.containedIn( <code>columnName, data</code> )</h3>
<p>
If you want to retrieve objects matching several different values, you can use containedIn, providing an array of acceptable values. This is often useful to replace multiple queries with a single query.
</p>
<div class="method-list">
<h6>Arguments</h6>
<dl class="argument-list">
<dt>columnName</dt>
<dd class="">string <span>The name of the column whose value is to be checked</span></dd>
<div class="clearfix"></div>
<dt>data</dt>
<dd class="">String, Integer, Double, String Array, Integer Array, Double Array <span>The value(s) that are to be matched with.</span></dd>
<div class="clearfix"></div>
</dl>
<h6>Returns</h6>
<p>Same query object, which can be helpful in chaining query functions.</p>
</div>
</div>
<div class="method-example" id="api-summary-example">
<code class="method-request"><span class="prompt"></span><span class="lang lang-node"><span class="highlight_js javascript">
curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{
"key": ${client_key},
"limit": 10,
"sort": {
},
"select": {
},
"query": {
"$includeList": [],
"name": {
"$nin": [],
"$in": ["adam",
"bengi"]
},
"$include": []
},
"skip": 0
}' 'http://api.cloudboost.io/data/${app_id}/${table_name}/find'
</span></span></code>
</div><!-- method-example -->
</div> <!-- method-section -->
<a id='CloudQuery-containsAll' name="CloudQuery-containsAll" class="section-anchor"> </a>
<div class="method-section">
<div class="method-description">
<h3>CloudQuery.containsAll( <code>columnName, data</code> )</h3>
<p>
Find objects where the array data in columnName contains all of the elements of data.
</p>
<div class="method-list">
<h6>Arguments</h6>
<dl class="argument-list">
<dt>columnName</dt>
<dd class="">string <span>The name of the column whose value is to be checked</span></dd>
<div class="clearfix"></div>
<dt>data</dt>
<dd class="">String, Integer, Double, String Array, Integer Array, Double Array <span>The value(s) that are to be matched with.</span></dd>
<div class="clearfix"></div>
</dl>
<h6>Returns</h6>
<p>Same query object, which can be helpful in chaining query functions.</p>
</div>
</div>
<div class="method-example" id="api-summary-example">
<code class="method-request"><span class="prompt"></span><span class="lang lang-node"><span class="highlight_js javascript">
curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{
"key": ${client_key},
"limit": 10,
"sort": {
},
"select": {
},
"query": {
"$includeList": [],