piyushcoader
Hi is there any way to connect mongodb with Ecto with latest version? I really need mongodb as a datastore. thanks in advance
I have gone through couple but this is not working well with latest release
-
GitHub - elixir-mongo/mongodb_ecto: MongoDB adapter for Ecto · GitHub
-
GitHub - elixir-mongo/mongodb: MongoDB driver for Elixir · GitHub
if anyone is using mongo in production with phoenix please share your experience
Thanks in Advance
Trending in Questions
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
Hello,
I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
So my question is quite simple and i have found no conclusive answer on forum, google or AI.
Should we use :erlang.float for Integer to ...
New
Documentation
While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
New
Other Trending Topics
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself.
My main conc...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixirconf-us
- #ai
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming











Showing Posts 1 to 10- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
hubertlepicki
Putting aside my whole dislike towards MongoDB (caused by unfortunate experience of using it’s earl-ish versions), I do not think you can get to work MongoDB as a back-end for Ecto 2.0 just yet. The work is still work in progress, and looks like the guy over here still hasn’t given up hope on making it work with each other: [WIP] Support for Ecto 2.0 by ankhers · Pull Request #91 · elixir-mongo/mongodb_ecto · GitHub
Having said that, there’s nothing from stopping you from using mongo driver directly (2nd link). It’s nice enough I think.
piyushcoader
thanks for quick reply looking forward to it. I would love to use postgres but the usecase suits to use mongodb for us. anyway thanks
hubertlepicki
I really doubt that this is true. Postgres can be configured to be very elastic and probably replace all cases where MongoDB can be used - with better result - with exception to keeping open cursors.
It may be as well that you do not need any of the above. You are in Erlang ecosystem in the end. Maybe you should consider some persistence solution like DETS if your data / use case allows that. But I can’t say more since I don’t know our use case
piyushcoader
Thanks, I am pretty new to postgres coming from meteor background. was using mongo alot but just found postgress can store jsonp data. i think i will stick with postgress now. thanks
hubertlepicki
yes, it can, and if you go with UUID for IDs and JSONB as datatype you get more or less the same “feel” as with Mongo with full support from Phoenix. JSONB field just becomes Map in Elixir.
Morganjackson
@hubertlepicki Do you happen to know of any good examples of using JSONB?
I’m trying to migrate a Meteor application to phoenix, but there are a couple of areas that use custom fields and I’m struggling to find examples on how to handle them.
So far I have this:
and then
This saves the JSONB correctly, but I’m not sure how to display it in my eex templates? Do I need to use Poison?
hubertlepicki
I am sorry, I don’t know. I only used it with
:mapdata type. I do not try to use too many ORM features as my relationship with those libs generally “is complicated”.When you use
:mapit uses Elixir’s maps that are pretty natural translation from one to another.ericmj
Ecto translates between jsonb and elixir maps so you will be working with normal elixir maps in your templates.
Morganjackson
@ericmj @hubertlepicki thanks for replying guys.
I think my data is either in the wrong format or I’m missing something.
Does the result below look correct? if so, how do I access “color”?
ericmj
That does look correct. These are normal elixir values so you can access color by
hd(hd(block.style).data)["color"].