javascript – Restructuring JSON to create a new JSON where properties are grouped according to similar values

I have a JSON structure in the following example format:

  {date: '01-01-2021', name: 'House 1', value: '500'},
  {date: '01-01-2021', name: 'House 2', value: '600'},
  {date: '01-01-2021', name: 'House 3', value: '700'},
  {date: '01-01-2021', name: 'House 4', value: '800'},
  {date: '01-02-2021', name: 'House 1', value: '200'},
  {date: '01-02-2021', name: 'House 2', value: '100'},
  {date: '01-02-2021', name: 'House 3', value: '300'},
  {date: '01-02-2021', name: 'House 4', value: '1000'},

I have written logic to group it in the following format:

  {date: '01-01-2021', 'House 1': 500, 'House 2': 600, 'House 3': 700, 'House 4': 800},
  {date: '01-02-2021', 'House 1': 200, 'House 2': 100, 'House 3': 300, 'House 4': 1000},

Below is code I have written. It works and seems to be efficient, but I am curious if this was the best approach or if there is a simpler way to accomplish this task? The actual data set contains a total of 2274 objects that is reduced to an array of 748 objects.


const housing_table_data = ((json_data) => {
        const unique_dates = housing_data.reduce((accumulator, current_value) => {
            if (accumulator.indexOf( === -1) {
            return accumulator;
        }, ());

        let table_data = ();

        unique_dates.forEach((date, index) => {
            table_data.push({date: date});

            let house_groupings = housing_data.filter(data => date);

            house_groupings.forEach(group => {
                table_data(index)( = group.value;

        return table_data;

Restructuring folder-based to Lightroom keywords

I recently resurrected an old computer which held my photos from 2001-2015, and am looking at how to best import them into my Lightroom catalog. The photos are right now in folders <year>/<dotted date or date-range>, <occassion>, eg 2008/2008.07.01-10, Mountain hike or 2010/2010.06.29-07.01, Visiting mom.

With my newer pictures, I’ve let Lightroom just import them to date-of-capture and used keywords to manage the “occassion” bit (and people in images etc).

I’d like to import the old images into the same date-based structure, and with keywords added for the occassion taken from the folder name. Is there a way to do this without a lot of manual work? Any automation tooling that can help?

Javascript – Restructuring of the Javacript object

Is there a way to create an object with just a few attributes from another?
In Adonis it is possible to filter which exact fields should be taken from one object of the request, and another is already created in a very cool way

Example: const user_data = request.only ((& # 39; name & # 39 ;, & # 39; email & # 39;)), which is the same thing he does. Const user_data = {name: request.all (). Name, email: request.all (). E-mail}

Organizational restructuring

What if core team developers work on a different product without informing managers? How can I stop it as HR? We do not have a permanent PM. Is that the problem? Do the mass withdrawals affect the organization? Is there a way to set the process flow for maintaining harmony on the ground? (P.S: it is a startup company)