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

Function _sanitizeQuery

databases/mongo.js:980–1002  ·  view source on GitHub ↗
(query)

Source from the content-addressed store, hash-verified

978/* Private functions */
979
980function _sanitizeQuery(query) {
981 if (query && query.$includeList) {
982 delete query.$includeList;
983 }
984
985 if (query && query.$include) {
986 delete query.$include;
987 }
988
989 if (query && query.$or && query.$or.length > 0) {
990 for (let i = 0; i < query.$or.length; ++i) {
991 query.$or[i] = _sanitizeQuery(query.$or[i]);
992 }
993 }
994
995 if (query && query.$and && query.$and.length > 0) {
996 for (let i = 0; i < query.$and.length; ++i) {
997 query.$and[i] = _sanitizeQuery(query.$and[i]);
998 }
999 }
1000
1001 return query;
1002}
1003
1004function _save(appId, collectionName, document) {
1005 const deferredMain = q.defer();

Callers 3

findFunction · 0.85
countFunction · 0.85
distinctFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected