MCPcopy Create free account
hub / github.com/CloudBoost/cloudboost / count

Function count

services/cloudObjects.js:46–62  ·  view source on GitHub ↗
(appId, collectionName, query, limit, skip, accessList, isMasterKey)

Source from the content-addressed store, hash-verified

44 return deferred.promise;
45 },
46 async count(appId, collectionName, query, limit, skip, accessList, isMasterKey) {
47 const deferred = q.defer();
48
49 try {
50 const _query = await _modifyFieldsInQuery(appId, collectionName, query);
51 const doc = await mongoService.document.count(appId, collectionName, _query, limit, skip, accessList, isMasterKey);
52 deferred.resolve(doc);
53 } catch (err) {
54 winston.log('error', {
55 error: String(err),
56 stack: new Error().stack,
57 });
58 deferred.reject(err);
59 }
60
61 return deferred.promise;
62 },
63 async distinct(appId, collectionName, onKey, query, select, sort, limit, skip, accessList, isMasterKey) {
64 const deferred = q.defer();
65

Callers

nothing calls this directly

Calls 2

_modifyFieldsInQueryFunction · 0.85
countMethod · 0.80

Tested by

no test coverage detected