grape-entity icon indicating copy to clipboard operation
grape-entity copied to clipboard

Collections of different objects

Open kris opened this issue 9 years ago • 2 comments

Hi,

I've seen other issues about doing nested collections of different data, but I believe my situation is slightly different. We have an ElasticSearch query that gets run across multiple indexes to return different content types. Is there a way to merge entities together or create a collection entity that would infer the entity from the object so we don't have to do a hacky feed using procs to conditionally expose stuff an entity?

Thanks!

kris avatar Jan 11 '16 18:01 kris

To iterate on my question, we're looking for output like such:

[
    { type: 'Article', attr1: 'val1', attr2: 'val2' },
    { type: 'Slideshow', attr3: 'val3', attr4: 'val4' }
    ...
]

Each object would be a different Entity, but I don't see a clear way to do this (though I might be overthinking it).

Thanks!

kris avatar Jan 14 '16 18:01 kris

I am trying to achieve something similar but couldn't get it. Were you able resolve it?

shama009 avatar Aug 10 '18 23:08 shama009