That would be sweet. I’m a busy guy as well but I would love to contribute as much as I can, especially since I’ve invested this driver into my software. I need to take some time to familiarize myself with some more of the technical details of mongo, but it definitely would be nice to see some of the more advanced features tie right into Xojo.
Ideally so we can write something technical like this:
I’ve just tagged v0.3.1 of the driver on GitHub, with some of the ideas implemented.
The project is now stored in the text format, which is much more Git-friendly than using the binary format.
[quote=222202:@Brock Nash]This could be vastly improved if a few things changed.
Instead of having the cursor have a "mClient" property it would be better if it had "mCollection"
Add these accessor methods on the MongoDriver classes:
Cursor.GetCollection() as MongoCollection //Returns mCollection
Collection.GetDatabase() as MongoDatabase //Returns mDatabase
Database.GetClient as MongoClient //Returns mClient[/quote]
I’ve decided to use read-only public properties instead of methods for this:
For those of you using the MongoDB driver in your projects, “jfdemer” picked up an issue with the driver.
Here is his description of the issue:
[quote]Now, the driver as it was din’t treat accented characters correctly. The culprit is decExtractCString.
Mongo string encoding is utf-8, but decExtractCString was adding each byte to the string one by one with Chr. So all characters that are more than a single byte in utf-8 were not added correctly to the string. With my modification, the entire string is taken from the bson memory block and converted to a utf-8 string.[/quote]
I’ve merged his fix into the main trunk. You guys can just do a pull request on your side to pull down the fix to your local project.
Nice finding. I am not sure this is relevant here but since pos is passed ByRef its value should be reset if strSize was NOT > 0 don’t you think? Like in:
If strSize > 0 Then
Dim s As String = DefineEncoding(bsonMB.StringValue(startPos, strSize), Encodings.UTF8)
return escapeJSON(s)
else
pos = startPos
End If
Even if I can’t get the replica set part working of my connection string, I at least need to talk over SSL authenticated with username and password
I’m currently getting:
{"ok":0,"errmsg":"auth failed","code":18}
It looks like it might be related to changes in Mongo Authentication
[quote]In MongoDB 3.0, it now supports multiple authentication mechanisms.
MongoDB Challenge and Response (SCRAM-SHA-1) - default in 3.0
MongoDB Challenge and Response (MONGODB-CR) - previous default (< 3.0)
If you started with a new 3.0 database with new users created, they would have been created using SCRAM-SHA-1.[/quote]
Nothing has changed in the driver for a long time, so if they changed the authentication method chances are that the driver as it is now won’t work.[/quote]
That’s what I was afraid of. @Alwyn Bester Do you have any links to the docs/protocols you used to write the original driver. Maybe I can find a way to update it
I’m in the process of launching 3 new products for my business at the moment, which requires all my devoted time, energy and focus at this point… so I unfortunately don’t have any time available to work on the MongoDB driver right now.
However, if you are willing to give the new authentication mechanism a shot, I would gladly give you full access to the GitHub repository. (Same goes for any other Xojo developer who would like to work on the MongoDB driver).
When I wrote the driver I used the official MongoDB documentation.
I did a quick search and I think the following link might be a good starting point…