mongodb_ecto icon indicating copy to clipboard operation
mongodb_ecto copied to clipboard

Support ecto prefixes

Open michalmuskala opened this issue 10 years ago • 1 comments
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

michalmuskala avatar Oct 16 '15 20:10 michalmuskala

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!

Xorelock avatar Mar 01 '17 03:03 Xorelock