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

Add phoenix guide to using Mongo #32

Open
michalmuskala opened this issue Jul 20, 2015 · 8 comments
Open

Add phoenix guide to using Mongo #32

michalmuskala opened this issue Jul 20, 2015 · 8 comments

Comments

@michalmuskala
Copy link
Collaborator

After #31 we need to add Mongo guide for Phoenix, similar to http://www.phoenixframework.org/docs/using-mysql

@vitalis
Copy link

vitalis commented Oct 13, 2015

👍

@brado
Copy link

brado commented Jan 24, 2016

👍 I concur, though I'd add that this is a very badly needed resource right now. Because it appears there are a lot of moving parts in transition with different versions emerging, it is difficult finding a full phoenix stack with dependencies that all work. I've spent the better part of the last week testing and trying to find versions of the following that will all work together, compile, generate, and test without errors:

  • phoenix
  • phoenix_ecto
  • ecto
  • mongodb_ecto
  • MongoDB (the server database itself)

As of this moment, I do not believe there is a set of current dependency versions where you can create a new phoenix project with a MongoDB database, generate HTML resources, and test cleanly. I've gotten close, but the invalid ID test still fails and needs manual intervention to change the test value for it to work.

Additionally, there is almost nothing out there which describes MongoDB schema design and how to accomplish it properly with Ecto.

This would be a very valuable resource.

@michalmuskala
Copy link
Collaborator Author

I agree such a document would be really useful. Contributions are welcome!

@tomjoro
Copy link

tomjoro commented Jan 25, 2016

@brado, isn't your list is missing the "Elixir MongoDB" driver from @ericmj? I thought mongodb_ecto was built on top of that. It seems that Ecto is supporting relational databases, except for MongoDB. A lot of MongoDB functionality will not fit easily into Ecto, e.g. m/r, findAndModify, flexible schema, etc, ( -- reasons for using MongoDB instead of a relational DB in the first place). Is it possible to use the MongoDB driver directly (without Ecto?) and/or have/make a new style Phoenix library for MongoDB (similar to Mongoid in Ruby)? Or maybe just some guides...

@brado
Copy link

brado commented Jan 25, 2016

@tomjoro I only listed the libraries that I had been working with directly, but it is quite possible that there are other relevant libraries that would need to be included in the list. Whatever the list, the important points are these:

  • Compatible dependency configurations shouldn't be an unknown.
  • How to get the library up and running quickly shouldn't be an unknown.
  • Common usage shouldn't be shrouded in questions.

The benefits for documenting these things well:

  • Users can get up and running quickly.
  • User retention -- there's a good chance more people will be using the library if they aren't quickly frustrated and either by desire or time constraints have to abandon for another solution.
  • More users means more potential contributors. By knowing more about the intent and architecture of how things work, they may be more equipped to pitch in, and do so sooner (I fall into this category -- I'd love to be posting pull requests rather than just reporting problems, but I'm going to have a ways to go until I understand things enough to do so).

@johnnyshields
Copy link

Something like this blog post would be useful: https://zackehh.com/using-mongodb-with-elixir-phoenix-and-ecto/

@tomjoro
Copy link

tomjoro commented Mar 5, 2017

I recently wrote a blog post: https://tomjoro.github.io/2017-02-09-ecto3-mongodb-phoenix/ - This does work well and is stable.

But I'm showing how to use ecto with mongodb, but not use mongodb_ecto (mongodb_ecto is a great stuff, but it's not compatible with ecto >= 2). If you check the comments there are some other people who have been similar things.

@ankhers
Copy link
Collaborator

ankhers commented Mar 6, 2017

@tomjoro You should check out the ecto-2 branch. It hasn't been officially release, but myself and a number of other people are using it production.

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

6 participants