question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Nested structures

See original GitHub issue

I was wondering if there would any support for parsing/unparsing nested structures, for instance:

[{
     a: {
          b: 'one',
          c: 'two',
          d: {
               e: 'three'
          }
     },
     f: 'four'
},
...
]

into field columns like a.b, a.c, a.d.e, f or something like that.

Thanks!

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
mholtcommented, Dec 8, 2014

If Papa did this, we would have to be very clear about what kind of structures are supported. For example, what about arrays, or would this only be nested objects? If it’s only objects, how do we explain that only an exact 2D array structure is supported? How would we handle unsupported structures (which we wouldn’t know was unsupported until deep inside it)?

Also, there are a lot of ways to map arbitrarily deep/complex structures into 2D space. I doubt users will have the same requirements on this aspect. And if it’s many-1 going one way, it would be impossible to properly map 1-many going the other way.

I think, rather than integrate something like this into the library, it would be more appropriate to make it a wrapper function. What do you think?

0reactions
PAEzcommented, Jul 5, 2015

Here’s how I converted the output to an object… http://plnkr.co/edit/8XqkQL?p=preview …its real simple code but worked for me 😉 Its not that hard to make something for your individual needs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

What are nested structures in C language? - Tutorialspoint
A structure inside another structure is called nested structure. Consider the following example, struct emp{ int eno; char ename[30]; float sal; ...
Read more >
Nested structure in C - Javatpoint
Nested Structure in C. C provides us the feature of nesting one structure within another structure by using which, complex data types are...
Read more >
Nested Structure in C - Scaler Topics
The structure is a user-defined data type used to store a group of items of different data types as a single data type....
Read more >
Nested Structure in C | C Program | Fresh2refresh
Nested structure in C is nothing but structure within structure. One structure can be declared inside other structure as we declare structure members...
Read more >
Nested Structure in C Programming Language Tutorial
In this tutorial, you will learn about Nested Structures in C Programming language.A Structure is a collection of similar elements.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found