LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

MongoDB GetCollectionNames

Hi,

I am Using MongoDB in LabVIEW.

I am able to retrieve all the data from the Mongo Database.

 

But unable to retrieve the Collection/Column names from the database.

 

Error:

Property Node (Arg :1) Error accessing property System.Collections.IEnumerator.Current, (System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
Inner Exception: System.InvalidOperationException: Enumeration has either not started or has already finished.) <append><b>System.InvalidOperationException</b> in code1.vi

 

For reference I am attaching the VI. Kindly Guide me on this.

 

Thank You.

0 Kudos
Message 1 of 3
(1,276 Views)

You should be using the output of MoveNext to determine whether there are any further items in the collection before attempting to retrieve an index (https://docs.microsoft.com/en-us/dotnet/api/system.collections.ienumerator.movenext?view=netframewor...).

 

In terms of debugging - check if there are any items in the backing collection (Count).

0 Kudos
Message 2 of 3
(1,208 Views)

The output of MoveNext is always 'False' even if there are collections in the database.

0 Kudos
Message 3 of 3
(1,186 Views)