The database called SR’s collection called EmailUs stores webmail from
users. Stored data include messages from users ands replies from our staff,
so in addition to email-message date and sender’s email address, a
composite key is included to group each email in the thread, composed of
the sender’s email address and a 64-bit integer (representing milliseconds
since Jan 1 1970) taken from their first email in the grouping. Thus the
system should be able to retrieve all emails belonging to a specific
thread, ordered by date sent and, marked as either originating from the
user or from staff.
An alternative solution could be using a REST-style API layer in front of
the MongoDB server, and perform queries on the MongoDB database using REST
instead of using a driver. Examples of REST interfaces can be found in the HTTP
Interface <https://docs.mongodb.org/ecosystem/tools/http-interfaces/> page.
Regarding your issues:
1) NuGet will not reference MongoDB drivers in CLR SQL assemblies in Visual
I believe Nuget is not supported for CLR SQL assembly. You would have to
add the dll files manually in the project.
2) I find legacy drivers documentation very confusing
Please let us know which page you find confusing, as there may be room for
improvements in the documentation.
3) I prefer to retrieve all records as a JSON array in a string variable,
and without MongoDB’s “id” field, as it will need to be removed.