elixir-mongo / mongodb_ecto

MongoDB adapter for Ecto
Apache License 2.0
368 stars 126 forks source link

Support ecto prefixes #43

Open michalmuskala opened 8 years ago

michalmuskala commented 8 years ago

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

Xorelock commented 7 years ago

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!