You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
using query.aggregate in cloud code results in TypeError.
Steps to reproduce
Parse.Cloud.define('aggregateQuery', function(req, res) {
var params = req.params;
var appId = params.appId
var option = {
useMasterKey: true
};
var promiseArray = [];
let pipline = [{$group: {_id :'$source', posts: {$sum : 1}}}];
let mediaquery = new Parse.Query('mediaContent');
mediaquery.aggregate(pipline, option)
.then((s) => {
res.scuccess(s);
}, (e) => {
res.error(s);
})
})
Actual Outcome
error: Error generating response. TypeError: mediaquery.aggregate is not a function
Environment Setup
Server
parse-server version (Be specific! Don't say 'latest'.) : [2.7.1]
Operating System: [OSX 10.13.2]
Localhost or remote server? (AWS, Heroku, Azure, Digital Ocean, etc): [Localhost]
Database
MongoDB version: [3.4.7 ]
Storage engine: [(MMAPv1)]
Localhost or remote server? (AWS, mLab, ObjectRocket, Digital Ocean, etc): [Localhost]
Logs/Trace
Include all relevant logs. You can turn on additional logging by configuring VERBOSE=1 in your environment.
verbose: REQUEST for [POST] /parse/functions/aggregateQuery: {} method=POST, url=/parse/functions/aggregateQuery, x-parse-application-id=Quifers_Dev_App_2016, content-type=application/json, x-parse-session-token=r:88524c8138d37f83d33abb0d065ea36f, cache-control=no-cache, postman-token=9777e1ac-437d-4761-83cd-ac1f6b1668f0, user-agent=PostmanRuntime/7.1.1, accept=/, host=localhost:8081, accept-encoding=gzip, deflate, content-length=0, connection=keep-alive,
error: Error generating response. TypeError: mediaquery.aggregate is not a function
at /Users/sauravazad/Documents/WebScript/parse-server/cloud/aggregateQuery.js:11:14
at /Users/sauravazad/Documents/WebScript/parse-server/node_modules/parse-server/lib/Routers/FunctionsRouter.js:176:9
at handleCloudFunction (/Users/sauravazad/Documents/WebScript/parse-server/node_modules/parse-server/lib/Routers/FunctionsRouter.js:144:14)
at /Users/sauravazad/Documents/WebScript/parse-server/node_modules/parse-server/lib/PromiseRouter.js:169:7
at Layer.handle [as handle_request] (/Users/sauravazad/Documents/WebScript/parse-server/node_modules/parse-server/node_modules/express/lib/router/layer.js:95:5)
at next (/Users/sauravazad/Documents/WebScript/parse-server/node_modules/parse-server/node_modules/express/lib/router/route.js:137:13)
at Route.dispatch (/Users/sauravazad/Documents/WebScript/parse-server/node_modules/parse-server/node_modules/express/lib/router/route.js:112:3)
at Layer.handle [as handle_request] (/Users/sauravazad/Documents/WebScript/parse-server/node_modules/parse-server/node_modules/express/lib/router/layer.js:95:5)
at /Users/sauravazad/Documents/WebScript/parse-server/node_modules/parse-server/node_modules/express/lib/router/index.js:281:22
at param (/Users/sauravazad/Documents/WebScript/parse-server/node_modules/parse-server/node_modules/express/lib/router/index.js:354:14)
The text was updated successfully, but these errors were encountered:
Parse-server @2.7.1 has incorrect version 1.10.2 for parse peer dependency .
Please release a new version with latest version of parse@1.11.0 @flovilmart
query.aggregate is not a function in Cloud code
using query.aggregate in cloud code results in TypeError.
Steps to reproduce
Parse.Cloud.define('aggregateQuery', function(req, res) {
var params = req.params;
var appId = params.appId
var option = {
useMasterKey: true
};
var promiseArray = [];
let pipline = [{$group: {_id :'$source', posts: {$sum : 1}}}];
let mediaquery = new Parse.Query('mediaContent');
mediaquery.aggregate(pipline, option)
.then((s) => {
res.scuccess(s);
}, (e) => {
res.error(s);
})
})
Actual Outcome
error: Error generating response. TypeError: mediaquery.aggregate is not a function
Environment Setup
Server
Database
Logs/Trace
Include all relevant logs. You can turn on additional logging by configuring VERBOSE=1 in your environment.
verbose: REQUEST for [POST] /parse/functions/aggregateQuery: {} method=POST, url=/parse/functions/aggregateQuery, x-parse-application-id=Quifers_Dev_App_2016, content-type=application/json, x-parse-session-token=r:88524c8138d37f83d33abb0d065ea36f, cache-control=no-cache, postman-token=9777e1ac-437d-4761-83cd-ac1f6b1668f0, user-agent=PostmanRuntime/7.1.1, accept=/, host=localhost:8081, accept-encoding=gzip, deflate, content-length=0, connection=keep-alive,
error: Error generating response. TypeError: mediaquery.aggregate is not a function
at /Users/sauravazad/Documents/WebScript/parse-server/cloud/aggregateQuery.js:11:14
at /Users/sauravazad/Documents/WebScript/parse-server/node_modules/parse-server/lib/Routers/FunctionsRouter.js:176:9
at handleCloudFunction (/Users/sauravazad/Documents/WebScript/parse-server/node_modules/parse-server/lib/Routers/FunctionsRouter.js:144:14)
at /Users/sauravazad/Documents/WebScript/parse-server/node_modules/parse-server/lib/PromiseRouter.js:169:7
at Layer.handle [as handle_request] (/Users/sauravazad/Documents/WebScript/parse-server/node_modules/parse-server/node_modules/express/lib/router/layer.js:95:5)
at next (/Users/sauravazad/Documents/WebScript/parse-server/node_modules/parse-server/node_modules/express/lib/router/route.js:137:13)
at Route.dispatch (/Users/sauravazad/Documents/WebScript/parse-server/node_modules/parse-server/node_modules/express/lib/router/route.js:112:3)
at Layer.handle [as handle_request] (/Users/sauravazad/Documents/WebScript/parse-server/node_modules/parse-server/node_modules/express/lib/router/layer.js:95:5)
at /Users/sauravazad/Documents/WebScript/parse-server/node_modules/parse-server/node_modules/express/lib/router/index.js:281:22
at param (/Users/sauravazad/Documents/WebScript/parse-server/node_modules/parse-server/node_modules/express/lib/router/index.js:354:14)
The text was updated successfully, but these errors were encountered: