-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Complex query #3661
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
we don't provide code level support on this repository, please use Stackoverflow. |
@flovilmart thank you ! another question is it possible to migrate form mongodb to postgres ? |
We don't provide migration from mongoDB to postgres, but you can probably use the ParseObject representation to make it happen. I will not enter the details of such procedure as not supported at the moment. @kulshekhar is running with postgres and I don't think he has seen any major issue. |
@chlebta I've been using parse with postgres for a few months and I haven't faced any postgres specific issues at all. The setup has an issue with memory leakage but I don't think that has anything to do with postgres. |
@kulshekhar I' thinking to migrate vers postures because it provide more consistance and also it support complex query (like join and much more) |
The key thing is that if you want to execute queries that can't be handled by parse natively, you're going to need another server to connect to your database and execute those queries. Now this server can be public facing or, as in my case, serve as a local service which gets consumed from cloud code. You'll also need to ensure that this part honors the permissions structure your app has. Now you have to decide whether you want to maintain two servers, one parse and one your own. Remember that you'll have to manage the scaling/availability of both. In my case I needed transactions but that comprised a small part of the entire app (less than 5% in terms of LOC, maintenance overhead) so it made sense to stick with parse and add a new service. If the maintenance requirements for the external service would've been much higher as a proportion, I wouldn't have chosen parse for this app. As to your last question, I don't have any experience using parse with android/ios but I don't see why you couldn't convert the result to the format you need. Parse server returns JSON. As long as your custom endpoints/queries return data in the right shape, it shouldn't be a problem. |
@kulshekhar Because all what I need is in some cases I've to use join table !! like in my example below |
@chlebta yeah, that's possible. You can mount parse-server on a regular express app cloud code can do anything you want it to do. You can call an external service from there. You could also create a connection and connect to the database from there if you want to (but it would be a terrible way to do this!) |
@kulshekhar I know it's a terrible idea but I can't find another way to do it ? any help for this one ? |
@chlebta I meant establishing a connection to the database from cloud code is a terrible idea. The rest of it (mounting parse on an express app, external service, etc) is fine! I was just trying to illustrate that cloud code isn't really limited to the functionality that was offered on the hosted service. |
@flovilmart @kulshekhar I've another question about postgres. |
Because that would imply different resolution logic between mongodb and Postgres. Foreign keys, joins etc... don't exist in mongodb, therefore, it wasn't implemented as SQL constructs. Those are resolved at runtime. |
@chlebta to add to what @flovilmart said, if your schema is stable and if you don't expect to drop/modify a column from the dashboard/parse API, adding a foreign key shouldn't be a problem. I haven't done this but I don't see any harm in trying this out (let us know how it works out!) |
To he different that a pointer is a string worth the form |
thank you :) One last question : what's the function that transform a |
@flovilmart @kulshekhar
|
@chlebta you have to use something else for file storage (S3, etc). By default, parse uses mongodb's GridStore. But since you're not using mongodb, this isn't available. |
@kulshekhar I'm already using server adapter :
|
Sorry for posting this issue here but it's urgent :
I need help for creating an complexe query:
First here's a schema for my db :

The
friends
model represent the friendship between two users.Each
user
has acity
What I'm trying to achieve is to create function that take an
userId
as input and return list of cities Sorted by number of friends.Here's my code until now
So the probleme is I can't figure a way way in parse or mongodb to join the two queries ?
The text was updated successfully, but these errors were encountered: