parse-server icon indicating copy to clipboard operation
parse-server copied to clipboard

Running $text Queries in Cloud Code

Open aaronbannin opened this issue 9 years ago • 2 comments

I'd like to run a $text query from Cloud Code. Everything is set up on the Mongo side, but I'm curious about the best way to run the query. Is there a way to access the existing Mongo connection to run a custom query?

aaronbannin avatar Jan 14 '17 23:01 aaronbannin

There is no way to access the parse-server connection from cloud code. However, cloud code is now just a node required file, loaded as any other module. You can create a connection of your own an run any direct query on the mongodb dataset. The results however won't be in Parse REST format.

flovilmart avatar Jan 14 '17 23:01 flovilmart

Thanks for the response! ᐧ

On Sat, Jan 14, 2017 at 3:46 PM, Florent Vilmart [email protected] wrote:

There is no way to access the parse-server connection from cloud code. However, cloud code is now just a node required file, loaded as any other module. You can create a connection of your own an run any direct query on the mongodb dataset. The results however won't be in Parse REST format.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ParsePlatform/parse-server/issues/3374#issuecomment-272662183, or mute the thread https://github.com/notifications/unsubscribe-auth/AGoF8IQJ3ysNVSrM5GFYy39rBQreKiKNks5rSV5hgaJpZM4LjxSq .

-- Thanks,

Aaron Bannin [email protected]

aaronbannin avatar Jan 15 '17 01:01 aaronbannin