zookzook / elixir-mongodb-driver

MongoDB driver for Elixir
Apache License 2.0
245 stars 63 forks source link

Compatibility changes to support mongodb_ecto adapter #227

Closed brennana closed 9 months ago

brennana commented 10 months ago

The mongodb_ecto package wishes to switch its underlying driver to this one, since it has better support for current MongoDB versions. However, a series of changes are required to support the adapter.

Some BSON encoders and a missing generic update function were added for the adapter. Plus, a small option fix for the do_log function in mongo.ex.

Most notably, the find-then-modify command functions find_one_and_update and find_one_and_replace now return appropriate FindAndModifyResult structs that contain additional write information otherwise neglected, which the adapter requires. This is also consistent with the other existing mutative command functions that already return respective result structs.

zookzook commented 10 months ago

Thanks for the PR. I will take a look at it as soon as possible. Maybe at the weekend.

zookzook commented 9 months ago

Thank you. I need to draft a new release, but this will break the API a bit because the find_and_modify function now returns the FindAndModifyResult.

zookzook commented 9 months ago

I released a new version 1.4.0 (https://hex.pm/packages/mongodb_driver)!