cortfritz

cortfritz

Has anyone gotten mogodb_ecto working with mongodb_driver?

I’m working on a project that uses :mongodb_driver (GitHub - zookzook/elixir-mongodb-driver: MongoDB driver for Elixir · GitHub). I use Ecto changesets but not full ecto queries. I’d like to be able to use libraries that use Ecto so I am looking into adding full Ecto via :mongodb_ecto. :mongodb_driver README says it has supported Ecto since v1.4.0.

I picked this driver some time ago as the repo seemed more alive. This driver also provides watch_collection which allows my elixir service to respond to changes in mongo.

:mongdb_ecto seems typically to use :mongodb, a different driver.

:mongdb_ecto expects the struct Mongo.Query to have the key :extra. :mongodb has this key in that struct, :mongodb_driver does not.

I’m using current versions, and have tried combinations of older versions but have not found a combination where this works.

I’m considering forking :mongodb_ecto to handle this, on the presumption that whatever :extra is doing I can work around it or bypass it as I don’t need it. If I find something elegant I can offer PR. I’m also asking :mongodb_driver maintainers if I can contribute, in which case I’ll figure out what work :extra is doing and submit a PR that supports it.

Maybe someboy else has figured this out and I can do something similar to what they did and not have to do the above.

Alternatively, maybe somebody has a different idea altogether. I’m open. I’m even willing to discuss at length “why aren’t you just using Postgres” which I expect from this joyus community. I might even find a path to that less costly than anything else, and projects like GitHub - mathieuprog/polymorphic_embed: Polymorphic embeds in Ecto · GitHub make this more tenable. But for now presume that I’d just like to learn how :mongodb_driver works with :mongodb_ecto, like I believe that it says it does.

First Post!

cortfritz

cortfritz

[:cricket:, :cricket:]

Where Next?

Popular in Questions Top

_russellb
I want to try my hand at web scraping. What tools/libraries do I need to use. I’m hoping to turn this into something professional so don’...
New
New
mcarvalho
What is the difference between System.get_env and Application.get_env? For example, what are best practices to use one versus another.
New
greenz1
I have a phoenix application from which a user can download multiple(5-6) files of size 1MB. I couldn’t find anything related to sending ...
New
Fl4m3Ph03n1x
About me? ( if you have nothing better to do than reading about some random guy in the internet :stuck_out_tongue: ) Hello all, this is ...
New
Emily
I have VueJS GUIs with the project generated using Webpack. I have Elixir modules that will need to be used by the VueJS GUIs. I forese...
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
JDanielMartinez
Hi! May someone helps me, please! I have two apps into an umbrella project: the first one is Database, which manages queries, and the se...
New
chensan
I have a User schema with a :from_id field set to type :string: defmodule TweetBot.Repo.Migrations.CreateUsers do use Ecto.Migration ...
New

Other popular topics Top

malloryerik
Hi, this is for people who, like me, have had some friction using .html.heex templates in VSCode. The solution seems to be, in a hyphena...
New
Darmani72
If I have a post route which an argument: post /my_post_route/:my_param1, MyController.my_post_handler How would get the post params ...
New
sorentwo
Hello! tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability. After spen...
985 42920 311
New
albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
belgoros
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
RisingFromAshes
I’ve read in another post that it may be possible with a router helper - but I couldn’t find an appropriate one, and tbh, I’m still just ...
New
fayddelight
I tried installing elixir 1.11.2 erlang 23.3.4 via asdf in my zsh shell. Enabled the versions locally and globally. When I list them ...
New
jononomo
For some reason my phoenix channels are working for me in my local dev environment, but as soon as I deploy via Docker, I get a 403 error...
New

Latest on Elixir Forum

We're in Beta

About us Mission Statement