MCPcopy Index your code
hub / github.com/parse-community/parse-server / handleFind

Method handleFind

src/Routers/ClassesRouter.js:22–52  ·  view source on GitHub ↗
(req)

Source from the content-addressed store, hash-verified

20 }
21
22 handleFind(req) {
23 const body = Object.assign(req.body || {}, ClassesRouter.JSONFromQuery(req.query));
24 const options = ClassesRouter.optionsFromBody(body, req.config.defaultLimit);
25 if (req.config.maxLimit && body.limit > req.config.maxLimit) {
26 // Silently replace the limit on the query with the max configured
27 options.limit = Number(req.config.maxLimit);
28 }
29 if (body.redirectClassNameForKey) {
30 options.redirectClassNameForKey = String(body.redirectClassNameForKey);
31 }
32 if (typeof body.where === 'string') {
33 try {
34 body.where = JSON.parse(body.where);
35 } catch {
36 throw new Parse.Error(Parse.Error.INVALID_JSON, 'where parameter is not valid JSON');
37 }
38 }
39 return rest
40 .find(
41 req.config,
42 req.auth,
43 this.className(req),
44 body.where,
45 options,
46 req.info.clientSDK,
47 req.info.context
48 )
49 .then(response => {
50 return { response: response };
51 });
52 }
53
54 // Returns a promise for a {response} object.
55 handleGet(req) {

Callers 6

mountRoutesMethod · 0.95
mountRoutesMethod · 0.45
mountRoutesMethod · 0.45
mountRoutesMethod · 0.45

Calls 4

classNameMethod · 0.95
JSONFromQueryMethod · 0.80
optionsFromBodyMethod · 0.80
findMethod · 0.65

Tested by

no test coverage detected