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

Function find

services/cloudObjects.js:24–45  ·  view source on GitHub ↗
(appId, collectionName, query, select, sort, limit, skip, accessList, isMasterKey, opts)

Source from the content-addressed store, hash-verified

22module.exports = {
23
24 async find(appId, collectionName, query, select, sort, limit, skip, accessList, isMasterKey, opts) {
25 const deferred = q.defer();
26
27 try {
28 if ((opts && opts.ignoreSchema) || (collectionName === '_File')) {
29 const doc = await mongoService.document.find(appId, collectionName, query, select, sort, limit, skip, accessList, isMasterKey);
30 deferred.resolve(doc);
31 } else {
32 const _query = await _modifyFieldsInQuery(appId, collectionName, query);
33 const doc = await mongoService.document.find(appId, collectionName, _query, select, sort, limit, skip, accessList, isMasterKey);
34 deferred.resolve(doc);
35 }
36 } catch (err) {
37 winston.log('error', {
38 error: String(err),
39 stack: new Error().stack,
40 });
41 deferred.reject(err);
42 }
43
44 return deferred.promise;
45 },
46 async count(appId, collectionName, query, limit, skip, accessList, isMasterKey) {
47 const deferred = q.defer();
48

Callers

nothing calls this directly

Calls 2

_modifyFieldsInQueryFunction · 0.85
findMethod · 0.80

Tested by

no test coverage detected