@@ -779,6 +779,7 @@ class Stack {
779
779
return this ;
780
780
}
781
781
/**
782
+ * @public
782
783
* @method entries
783
784
* @description
784
785
* Query for a set of entries on a content type
@@ -804,6 +805,7 @@ class Stack {
804
805
throw new Error ( 'Kindly call \'contentType()\' before \'entries()\'!' ) ;
805
806
}
806
807
/**
808
+ * @public
807
809
* @method asset
808
810
* @description
809
811
* Query for a single asset
@@ -835,6 +837,7 @@ class Stack {
835
837
return stack ;
836
838
}
837
839
/**
840
+ * @public
838
841
* @method assets
839
842
* @description
840
843
* Query for a set of assets
@@ -859,6 +862,7 @@ class Stack {
859
862
return stack ;
860
863
}
861
864
/**
865
+ * @public
862
866
* @method schema
863
867
* @description
864
868
* Query for a single content type's schema
@@ -891,10 +895,10 @@ class Stack {
891
895
return stack ;
892
896
}
893
897
/**
898
+ * @public
894
899
* @method schemas
895
900
* @description
896
901
* Query for a set of content type schemas
897
- * @public
898
902
* @example
899
903
* Stack
900
904
* .schemas()
@@ -915,9 +919,11 @@ class Stack {
915
919
return stack ;
916
920
}
917
921
/**
922
+ * @public
923
+ * @method limit
924
+ * @description
918
925
* Parameter - used to limit the total no of items returned/scanned
919
926
* Defaults to 100 (internally, which is overridden)
920
- *
921
927
* @param {number } no Max count of the 'items' returned
922
928
*
923
929
* @example
@@ -944,9 +950,11 @@ class Stack {
944
950
throw new Error ( 'Kindly provide a valid \'numeric\' value for \'limit()\'' ) ;
945
951
}
946
952
/**
953
+ * @public
954
+ * @method skip
955
+ * @description
947
956
* Parameter - used to skip initial no of items scanned
948
957
* Defaults to 0 (internally, which is overridden)
949
- *
950
958
* @param {number } no Min count of the 'items' to be scanned
951
959
*
952
960
* @example
@@ -973,6 +981,9 @@ class Stack {
973
981
throw new Error ( 'Kindly provide a valid \'numeric\' value for \'skip()\'' ) ;
974
982
}
975
983
/**
984
+ * @public
985
+ * @method query
986
+ * @description
976
987
* Wrapper around a raw query wrapper
977
988
* @param {object } queryObject Query filter
978
989
*
@@ -1001,6 +1012,9 @@ class Stack {
1001
1012
return this ;
1002
1013
}
1003
1014
/**
1015
+ * @public
1016
+ * @method only
1017
+ * @description
1004
1018
* Projections - returns only the fields passed here
1005
1019
*
1006
1020
* @param {array } fields Array of 'fields', separated by dot ('.') notation for embedded document query
@@ -1034,6 +1048,9 @@ class Stack {
1034
1048
return this ;
1035
1049
}
1036
1050
/**
1051
+ * @public
1052
+ * @method except
1053
+ * @description
1037
1054
* Projections - returns fields except the ones passed here
1038
1055
*
1039
1056
* @param {array } fields Array of 'fields', separated by dot ('.') notation for embedded document query
@@ -1066,6 +1083,9 @@ class Stack {
1066
1083
return this ;
1067
1084
}
1068
1085
/**
1086
+ * @public
1087
+ * @method regex
1088
+ * @description
1069
1089
* Raw regex to be applied on a field - wrapper
1070
1090
*
1071
1091
* @param {string } field Field on which the regex is to be applied on
@@ -1152,6 +1172,7 @@ class Stack {
1152
1172
return this ;
1153
1173
}
1154
1174
/**
1175
+ * @public
1155
1176
* @method where
1156
1177
* @summary Pass JS expression or a full function to the query system
1157
1178
* @description
@@ -1252,6 +1273,8 @@ class Stack {
1252
1273
return this ;
1253
1274
}
1254
1275
/**
1276
+ * @public
1277
+ * @method includeContentType
1255
1278
* @description
1256
1279
* Includes 'content_type' key in response, which is the content type schema of the entries filtered/scanned
1257
1280
* @example
@@ -1274,6 +1297,7 @@ class Stack {
1274
1297
return this ;
1275
1298
}
1276
1299
/**
1300
+ * @public
1277
1301
* @method excludeReferences
1278
1302
* @description
1279
1303
* Excludes all references of the entries being scanned
@@ -1299,6 +1323,7 @@ class Stack {
1299
1323
return this ;
1300
1324
}
1301
1325
/**
1326
+ * @public
1302
1327
* @method queryReferences
1303
1328
* @description
1304
1329
* Wrapper, that allows querying on the entry's references.
@@ -1329,14 +1354,8 @@ class Stack {
1329
1354
}
1330
1355
throw new Error ( 'Kindly pass a query object for \'.queryReferences()\'' ) ;
1331
1356
}
1332
- queryReferencesBeta ( query ) {
1333
- if ( query && typeof query === 'object' ) {
1334
- this . internal . queryReferencesBeta = query ;
1335
- return this ;
1336
- }
1337
- throw new Error ( 'Kindly pass a query object for \'.queryReferences()\'' ) ;
1338
- }
1339
1357
/**
1358
+ * @public
1340
1359
* @method getQuery
1341
1360
* @description
1342
1361
* Returns the query build thusfar
@@ -1364,7 +1383,11 @@ class Stack {
1364
1383
* .includeAllReferences()
1365
1384
* @returns {Stack } Returns 'this' instance (of Stack)
1366
1385
*/
1367
- includeReferences ( ) {
1386
+ includeReferences ( depth ) {
1387
+ console . warn ( '.includeReferences() is a relatively slow query..!' ) ;
1388
+ if ( typeof depth === 'number' ) {
1389
+ this . q . referenceDepth = depth ;
1390
+ }
1368
1391
this . internal . includeAllReferences = true ;
1369
1392
return this ;
1370
1393
}
@@ -1394,6 +1417,7 @@ class Stack {
1394
1417
return this ;
1395
1418
}
1396
1419
/**
1420
+ * @public
1397
1421
* @method find
1398
1422
* @description
1399
1423
* Queries the db using the query built/passed
@@ -1476,6 +1500,7 @@ class Stack {
1476
1500
} ) ) ;
1477
1501
}
1478
1502
/**
1503
+ * @public
1479
1504
* @method count
1480
1505
* @descriptionReturns the count of the entries/assets that match the filter
1481
1506
* @param {object } query Optional query filter object
@@ -1501,6 +1526,7 @@ class Stack {
1501
1526
} ) ;
1502
1527
}
1503
1528
/**
1529
+ * @public
1504
1530
* @method findOne
1505
1531
* @description
1506
1532
* Queries the db using the query built/passed. Returns a single entry/asset/content type object
0 commit comments