Have I any chance to serialize meta (any format, so I can store it in DB)?
var obj1 = {};
var obj2 = {};
obj1.link = obj2;
obj2.link = obj1;
var meta = [obj1, obj2];
As I understand the problem is that JSON serialize object`s links to objects.
One approach is to use an object as the outermost container, using the keys of the object as the ids:
var objs = {
obj1: { link: "obj2" },
obj2: { link: "obj1" }
}
Then you can follow the links with just a property lookup:
var o1 = objs["obj1"];
var o2 = objs[o1.link];
And this converts to JSON without needing any conversions