From_json to_json


I am having trouble finding documentation for using from_json or to_json

example of problem

var connection_string = “Driver={MySQL ODBC 5.3 ANSI Driver};”;

var o = myodbc(connection_string);
var r = o.connect();

// the json return from function is valid and without errors

var ret = from_json®;

// is a string and is always “connect”

print (; // error says not a function
print (to_string(; // error as well


It’s true that those functions are not well documented.

The from_json takes a string, then returns the “strongly-typed-thing” that it represents. So in your case, it’s returning a map object.

So, you’d need to do


I should add some kind of to_object function that does a deep conversion of nested maps into objects that would work with the . notation. It’s also possible to add your own method_missing overload for maps that would do the same thing, see here:

If you have any questions about that, let me know.


Dang …
Thank you for your quick reply and I really should have thought of that

I did more tests ( more complex json )

and it worked perfectly.

All my plugins return json so i need to be able to use this in scripting -

Thank You for your assistance in this matter