[英]Is it possible to called a Parse defined cloud code function from the cloud?
I have several cloud code functions defined like... 我有几个定义的云代码功能,例如...
Parse.define("getPostsNearby"...
Parse.define("getPostsToday"...
Parse.define("getPostsBlah"...
The only difference is the parameters they take in. 唯一的区别是它们采用的参数。
I was wondering if it would be possible to create a function... 我想知道是否有可能创建一个函数...
Parse.define("getPosts"...
That would analyse the input parameters and then run the relevant cloud code function? 那将分析输入参数,然后运行相关的云代码功能? Sort of like a routing function.
有点像路由功能。 So if a geoPoint is passed into the parameters it will call the
getPostsNearby
cloud code function and then return the results from that. 因此,如果将geoPoint传递到参数中,它将调用
getPostsNearby
云代码函数,然后从中返回结果。
Is it possible to do this? 是否有可能做到这一点?
Try Parse.Cloud.run(name, data, options)
or Parse.Cloud.httpRequest(options)
尝试
Parse.Cloud.run(name, data, options)
或Parse.Cloud.httpRequest(options)
ref. REF。 Parse.Cloud.run , Parse.Cloud.httpRequest
Parse.Cloud.run , Parse.Cloud.httpRequest
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.