@@ -136,13 +136,14 @@ To get a single entry, you need to specify the content type as well as the ID of
136
136
``` javascript
137
137
const Query = Stack .ContentType (' blog' ).Entry (" <entry_uid>" );
138
138
139
- Query .fetch ()
140
- .then (function success (entry ) {
141
- console .log (entry .get (' title' )); // Retrieve field value by providing a field's uid
142
- console .log (entry .toJSON ()); // Convert the entry result object to JSON
143
- }, function error (err ) {
144
- // err object
145
- })
139
+ Query
140
+ .toJSON ()
141
+ .fetch ()
142
+ .then (function success (entry ) {
143
+ console .log (entry .get (' title' )); // Retrieve field value by providing a field's uid
144
+ }, function error (err ) {
145
+ // err object
146
+ })
146
147
```
147
148
148
149
To retrieve multiple entries of a content type, you need to specify the content type uid. You can also specify search parameters to filter results.
@@ -151,19 +152,19 @@ To retrieve multiple entries of a content type, you need to specify the content
151
152
const Query = Stack .ContentType (' blog' ).Query ();
152
153
153
154
Query
154
- .where (" title" , " welcome" )
155
- .includeContentType ()
156
- .includeCount ()
157
- .toJSON ()
158
- .find ()
159
- .then (function success (result ) {
160
- // result is array where -
161
- // result[0] => entry objects
162
- // result[result.length-1] => entry objects count included only when .includeCount() is queried.
163
- // result[1] => schema of the content type is included when .includeContentType() is queried.
164
- }, function error (err ) {
165
- // err object
166
- })
155
+ .where (" title" , " welcome" )
156
+ .includeContentType ()
157
+ .includeCount ()
158
+ .toJSON ()
159
+ .find ()
160
+ .then (function success (result ) {
161
+ // result is array where -
162
+ // result[0] => entry objects
163
+ // result[result.length-1] => entry objects count included only when .includeCount() is queried.
164
+ // result[1] => schema of the content type is included when .includeContentType() is queried.
165
+ }, function error (err ) {
166
+ // err object
167
+ })
167
168
```
168
169
169
170
#### Cache Policies
0 commit comments