ni.com is currently undergoing scheduled maintenance.
Some services may be unavailable at this time. Please contact us for help or try again later.
07-22-2022 01:26 AM
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.
07-24-2022 02:41 PM
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).
07-25-2022 03:55 AM
The output of MoveNext is always 'False' even if there are collections in the database.