zookzook
MongoDB driver - an alternative MongoDB driver
Announcing an alternative MongoDB Driver! Do you like the MongoDB despite the general opinion a database always has to be an sql database? Would you like to use your favorite database with your favorite language? Then you are right here!
Sadly there is no official driver (I do not know why?). So you have to take things into your own hands and write the driver yourself. Currently the implementation does not support all features yet. But over time (hopefully) the succesive expansion of the missing features will take place.
Features:
- Supports MongoDB versions 3.2, 3.4, 3.6, 4.0
- Connection pooling (through DBConnection 2.x)
- Streaming cursors
- Performant ObjectID generation
- Follows driver specification set by 10gen
- Safe (by default) and unsafe writes
- Aggregation pipeline
- Replica sets
- Support for SCRAM-SHA-256 (MongoDB 4.x)
- Support for change streams api (See)
Most Liked
zookzook
The new version 0.6.0 has been released. Additional features since last announcing (May 4):
-
Support for bulk writes (See specs)
-
support for driver sessions (See specs)
-
support driver transactions (See specs)
-
Enhancements
- refactored
writeConcern - refactored
filter_nils - refactored usage of
ReadPreference - added support for sessions (
ServerSession,SessionPool,Session) - added Decimal128 encoder
- added support for transactions
- added support for transaction to gridfs and bulk operation
- added
createcommand (explicitly creating a collection or view) - Supports MongoDB versions 3.2, 3.4, 3.6, 4.0, 4.2
- refactored
Check the documentation for more information:
zookzook
Announcing a helper library to support using structs instead of bare maps while using the MongoDB-Driver:
Features:
- automatic load and dump function
- reflection functions
- type specification
- support for embedding one and many structs
- support for
after loadfunction - support for
before dumpfunction - support for id generation
- support for default values
- support for derived values
The module creates some boilerplate code, so you can use structs for your data. You call load/1 to convert the map from the driver to your struct. To save your struct to MongoDB you call dump/1 before you call insert_one or insert_many.
Check out the docs!
zookzook
let me say: tempus fugit.
mongox - DEPRECATED
mongo - 0.5.4 December 1, 2015 (docs)
mongodb_erlang - seems not to support op_msg (since 3.6)
Unfortunately, the libraries are not up-to-date regarding the MongoDB server. Since I use the latest version of my projects and therefore want to use the features of the server, I was looking for a suitable driver. Unfortunately I did not find one, so I searched for the best starting point and developed my own driver.
zookzook
The new version 1.0.0 has been released:
Enhancements:
- add migration (da65de4)
- improve the dump and load functions (#154) (e7f2d44)
- use the same timestamps in new/0 function (0db61da)
Bugfix:
- remove a bug in the hello handshake protocol (thanks to fireproofsocks for reporting) (59aa841)
- remove derived attributes in the dump function (c1b60b4)
Breaking changes - Mongo.Repo and Collections Module
Prior to version 0.9.2 the dump/1 function returns atoms as key. Since the dump/1 function is the inverse function of load/1, which uses binary keys as default, the dump/1 function should return binary keys as well.
Prior to version 0.9.2 some Mongo.Repo functions use the dump/1 function for the query (and update) parameter. This worked only for some query that used only the attributes of the document. In the case of nested documents, it didn’t work, so it is changed to be more consistent. The Mongo.Repo module is very simple without any query rewriting like Ecto does. In the case you want to use the :name option, you need to specify the query and update documents in the Mongo.Repo functions following the specification in the MongoDB.
If you upgrade the driver to version 1.0.0 and you use the collection feature, please check you code!
zookzook
The new version 0.7.0 has been released:
- support for command monitoring
- support for retryable reads
- support for retryable writes
Enhancements:
- refactored the api of
Mongo.limitsandMongo.wire_version - add support for tracking recovery token from response in a sharded transaction
- new function
BSON.ObjectId.decode/1andBSON.ObjectId.encode/1 - new function
Mongo.uuid/1 - refactored event notification system
- refactored the test cases
- now using mtools for a MongoDB deployment in the travis ci environment
-
Session.commit_transactionreturns now:okor an error{:error, %Mongo.Error{}} - support for
errorLabels







