-
Notifications
You must be signed in to change notification settings - Fork 21
Open
Description
What If a want to group some properties on a nested object.
Here's a sample:
resultMaps = [
{
mapId: 'teamMap',
idProperty: 'id',
properties: ['name'],
associations: [
{ name: 'players', mapId: 'playerMap', columnPrefix: 'player_' }
]
},
{
mapId: 'playerMap',
properties: ['name']
}
]
resultSet = [
{ team_id: 1, team_name: 'New England Patriots', player_name: 'Tom Brady' }
];
mappedResult = joinjs.map(resultSet, resultMaps, 'teamMap', 'team_');
expect(mappedResult).to.deep.equal [
{
id: 1
name: 'New England Patriots'
player: {
name: 'Tom Brady'
}
}
]
Is this possible?
Metadata
Metadata
Assignees
Labels
No labels