Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9116589
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T04:42:40+00:00 2026-06-17T04:42:40+00:00

I have a very big Json file (dataset is bigger then 30 000) .

  • 0

I have a very big Json file (dataset is bigger then 30 000) . I need to check if a part of the value of a certain key is the same as a given string and then increment an int.

This is part of the Json:

[
    {
        "geo": null,
        "coordinates": null,
        "in_reply_to_status_id_str": null,
        "contributors": null,
        "in_reply_to_user_id": null,
        "in_reply_to_status_id": null,
        "truncated": false,
        "created_at": "Tue Nov 13 20:17:17 +0000 2012"

I want to check if the key “created_at” has a certain day(value). Like for example ‘Tue’
and then increment : var tuesday = 0;

only thing i could come up with is this function:

function getValues(obj, key) {
    var objects = [];
    for (var i in obj) {
        if (!obj.hasOwnProperty(i)) continue;
        if (typeof obj[i] == 'object') {
            objects = objects.concat(getValues(obj[i], key));
        } else if (i == key) {
            objects.push(obj[i]);
        }
    }
    return objects;
}

But it only checks the key and puts the value in an array. That is not what i want.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T04:42:42+00:00Added an answer on June 17, 2026 at 4:42 am

    It is not immediately clear from your question what the structure of the data is, but it looks to be an array of objects where the created_at property will be populated with a Date. If you need it to be recursive (which the code you provided suggests) the following code would need modification. But going off the description:

    I want to check if the key “created_at” has a certain day(value). Like
    for example ‘Tue’ and then increment : var tuesday = 0;

    Then the following will take the array as data and result in the variable value containing an object with a map of days and the number of items where the created_at property begins with each of the 7 day of week strings.

    var valMap = {
      Sun: 'sunday',
      Mon: 'monday',
      Tue: 'tuesday',
      Wed: 'wednesday',
      Thu: 'thursday',
      Fri: 'friday',
      Sat: 'saturday'
    }
    
    var value = data.reduce(function(m, i, x){
      for (d in valMap){
        if (i.created_at.indexOf(d) === 0){
          m[valMap[d]]++;
          return m;
        }
      }
      return m;
    }, {
      sunday: 0,
      monday: 0,
      tuesday: 0,
      wednesday: 0,
      thursday: 0,
      friday: 0,
      saturday: 0
    });
    

    result would resemble:

    {
      sunday: 0,
      monday: 1,
      tuesday: 3,
      wednesday: 0,
      thursday: 1,
      friday: 0,
      saturday: 6
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a very big CSV file (1GB+), it has 100,000 line. I need
I have very very big html page/data. I need to fetch data under h1
I have a very big hadoop sequence file in the hdfs. what is the
Is there any batch script compiler available? I have a very big batch file
I have to load a very big JSON object and perform various expensive processes.
I have data that I convert to JSON. I need storage to be very
I have a very big table of measurement data in MySQL and I need
I have a very big .txt file of millions of strings and it has
I have a very big file 4GB and when I try to read it
I have a very large JSON string that I need to parse with in-browser

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.