02-17-2020 08:01 AM
Hi Hollowhorse,
Thanks for that swift reply.
Is it possible to access MongoDB using HTTP POST and GET methods?
Also, it possible to do the same using Wire Protocol (TCP Socket)?
Regards,
Saptarshi Pan
02-17-2020 09:05 AM - edited 02-17-2020 09:07 AM
Hi Saptarshi,
Well.... anything is possible 😉
I did look at using the HTTP POST and GET methods originally, but the functionality was very limited at the time.
It's definitely possible to use Wire protocol, but that means writing your own drivers from scratch. That's something which has always appealed to me, but I've never had the time (or foolhardiness) to try it.
Regards,
Hollowhorse
02-20-2020 03:33 AM
Hi, Hollowhorse
What do I to get the N documents from MongoDB in LabView?
I tried a few things, but I believe it would be best if we can replicate this command line statement db.collectionName.find({"_id": 0}).sort({"_id": -1}).limit(100).pretty(). Can we do this using the RBX Systems Driver
02-20-2020 06:16 AM
Hi Saptarshi,
That's an odd query seeing as MongoDB normally forces unique values for _id. In theory you can only ever have one instance where _id = 0. Regardless, I have written some LabVIEW code to replcate your query. I have to be honest, handelling .NET in LabVIEW is quite longwinded - so the code looks more complicated than it actually is. As I've said before, I'd advise encapsulating some of the common .NET driver functions into VI's.
I'm afraid I can't comment on the RBX driver. At the time I was working on my project it didn't do what I needed, but it may have come on since then.
Regards,
hollowhorse
04-27-2020 09:32 AM
Hi all,
I tried to access database with user/password without success.I have always same error:
Constructor Node Error creating instance of MongoClient in assembly MongoDB.Driver.MongoClient, MongoDB.Driver, Version=1.8.3.9, Culture=neutral, PublicKeyToken=f686731cfb9cc103, (System.NotSupportedException: Unsupported MongoAuthenticationMechanism SCRAM-SHA-1.) <append><b>System.NotSupportedException</b> in TestMongoDB.vi
Connection string like:
mongodb://user:passw@host/admin?authMechanism=SCRAM-SHA-1
What is wrong? Database is 4.0.
Thanks in advance!!!
10-26-2021 08:23 AM
What would i need to do to open the MongDB Test.vi without having the project open. I would like to add this to the code that I am currently working to develop some reusable code outside of a project scenario.
It is broken without the project open and when I try to right click and select a constructer I can browse to the mongodb.driver.dll but when opening I get "An error occurred trying to load assembly."
I think this can sometimes be caused by one dll being dependent on another and that they may need to be in the same directory. The MongoDB.Bson.dll and MongoDB.Driver.dll are in the same folder but the mscorlib.dll is not and I find 81 versions of this on my PC. I tried moving a couple of them into the same folder but it did not help.
Is there a way to do this?
07-25-2023 04:36 AM
Has anyone been able to solve this issue?
I am facing a problem with loading the latest "MongoDB.Driver.dll" in LabVIEW. Strangely, when I load the 2014 version of the DLL, LabVIEW accepts it without any issues. However, when I attempt to load the latest version, I encounter the same error as HMunster reported earlier. I've tried using both LabVIEW 32-bit and 64-bit versions, but unfortunately, I haven't had any success in resolving the problem.
If anyone has encountered a similar issue or has any insights into resolving this problem, I would greatly appreciate your input.
Kind Regards,
Jacques
07-25-2023 05:48 AM
I'm still using a really old version of the C# driver in LabVIEW. It doesn't support some of the newer features, like transactions and the Decimal128 data type, but it works perfectly fine in all other respects.
07-26-2023 07:39 AM
This was great got this example working at one point, but now that I need to use it with the latest Mongodb it no longer works. Does anyone have an idea why? Using LabVIEW 2021, Mongodb 5.0.6 2008R2PLUS SSL(64Bit) worked but with MongoDB 6.0.8 2008R2Plus SSL (64Bit) it does not work.
07-27-2023 01:45 AM
I came right!
For some reason using the "Signed" version of the driver worked, but the only one I could find was version 2.19 just shy of 2.20 but still good enough.
To get started, open Visual Studio and access the "NuGet Package Manager Console." Install the below provided NuGet packages and then compile the DLLs. Remember to create a dummy DotNet project first before executing the commands else it will not work. After successful compilation, you can locate the DLLs stored folder location under the "References" section in the right column.
NuGet Gallery | MongoDB.Bson.signed 2.19.0
NuGet Gallery | MongoDB.Driver.signed 2.19.0
Kind Regards
Jacques.