Skip to content
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

How to use an existing mongodb with parse #5429

Closed
devSarry opened this issue Mar 18, 2019 · 4 comments
Closed

How to use an existing mongodb with parse #5429

devSarry opened this issue Mar 18, 2019 · 4 comments

Comments

@devSarry
Copy link

Hey is there a way to use Parse with an existing mongodb? Lets say we have a python project that used mongo for the db. Can we put parse in front of the db to create a server web clients can use?

@georgesjamous
Copy link
Contributor

georgesjamous commented Mar 18, 2019

@dopyoman your question is best suited on StackOverflow, check this current thread #5419


Nevertheless, I will try to answer your question since you seem new to parse-community.
First of all, please read the documentation/wiki and run a local development test project, save and query some objects to get an idea of what parse is and how data is saved in the database.

Now, to answer your question, yes, but you need to migrate your current data.
Parse saves data to MongoDB in the form of an object, each object has an objectId and some other default fields. Without migration, an object will not be read correctly from mongo and you risk having corrupted data all over and errors firing in your parse-server.

What you have to do is.
Learn more about parse (it easy!), start a local server to see how it works and how data is saved, then draft a migration plan of your current data and run the migration script.
Then, you can use parse-server correctly.

Also, parse is written in NodeJs and cloud functions have to be written in NodeJs. To run scripts in python, you can use Aws Lambda functions and invoke them remotely.
Hope this helps!

Please close this ticket as it is not an issue, and it is very unlikely that you will find another answer looking at issues.

@acinader
Copy link
Contributor

@dopyoman gonna close this out. Feel free to re-open if you think we're missing something and this is an issue with parse-server.

@devSarry
Copy link
Author

@georgesjamous Thank you for taking the time to respond. Basically what you are saying is we would have to take each document and migrate it through the parse api for it to work correctly. Again thank you for taking the time to answer.

@georgesjamous
Copy link
Contributor

georgesjamous commented Mar 19, 2019

If you want to access your documents from the Parse-API, yes you have to migrate your data through the Parse-API. That way parse-server correctly creates the schema for each class/collection.

Also, if you have relationships between your existing documents, you have to fix/replace the Ids by the ones created by parse, since parse generates a new id for each object. You can also take advantage of Pointers and Relations available in parse. Everything well documented in the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants