mongodb_ecto
mongodb_ecto copied to clipboard
Support ecto prefixes
trafficstars
The prefixes should change the database, once it's possible from the driver.
They should be supported in all queries and in migrations: https://github.com/elixir-lang/ecto/issues/1004
mongo_ecto/lib/mongo_ecto/connection.ex:45: (on the ecto-2 branch, using ericmj/mongodb master)
-opts = [projection: projection, sort: query.order] ++ query.opts ++ opts +opts = [projection: projection, sort: query.order, database: query.database] ++ query.opts ++ opts
haven't figured out why it's query.database and not query.prefix, but that might be an implementation detail of NormalizedQuery... ?
This was a good excuse to learn elixir debugging tools. hope this helps!