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
[
,
]
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance









