vapor-community / mongo-driver

MongoDB driver for Fluent
28 stars 26 forks source link

Future improvements #34

Open Joannis opened 7 years ago

Joannis commented 7 years ago

I've compiled a list of suggestions for the mongo-driver that can be added in the future by one or more PRs.

MongoDB version checking for feature levels.

Currently, $lookup is the only method for left-joins and was first introduced in MongoDB 3.2. Although MongoDB versions before 3.2 aren't supportable unless multiple queries are manually sent, MongoKitten exposes version and other build information of the server here and here. This can be used to throw errors without sending information to MongoDB it cannot process and give more accurate errors.

Support for MongoDB operators

MongoDB supports arrays and other recursive (dictionary/array) structures thoroughly. Operators that interact with arrays are almost a necessity and should be added to the query builder.

Support for GeoJSON and Graph queries amongst others

Through aggregates, and commands such as geoNear, many more complicated queries can be supported. It's almost essential for many MongoDB users to be able to rely on tools like this.

Collations and read/write concerns

In MongoDB these aren't part of the schema but part of a query, although read concerns aren't usually important, collations can prove helpful to MongoDB users working with other alphabets and even accents on letters. Write concerns may prove to be important to some specific data sets such as payments in webshops.