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 7859661
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T21:58:30+00:00 2026-06-02T21:58:30+00:00

I am looking to store the following data structure: TIMESTAMP | NAME | COUNTS

  • 0

I am looking to store the following data structure:

TIMESTAMP | NAME | COUNTS

For each time stamp, there can be multiple names, and each name has a list of counts:

123456 | EXAMPLE1 | 1,2,3,4
       | EXAMPLE2 | 4,3,2,1
       | EXAMPLE3 | 9,7,4,3

I would like to store the timestamp as an object index so that I can access it when I know the timestamp. This also eliminates any issues with array size limits and defining etc.

What I dont know is how to create a list of “names” for each timestamp, and for each name I would like to store a list of counts.

Can anyone advise how I can create this data structure and access all counts for a specific timestamp and name?

So far I have this:

dataObj[timestamp] = new Array(name,[count]);

But i have 2 questions:

1) How would I test to see if I already have the name?

2) How would I add another name array?

Appreciate any comments.

Regards, Ben.

  • 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-02T21:58:35+00:00Added an answer on June 2, 2026 at 9:58 pm

    Given a timestamp, a name, and a count:

    // if we haven't seen this timestamp, create a new object for it
    dataObj[timestamp] = dataObj[timestamp] || {}; 
    
    // if we haven't seen this name yet in this time stamp, create a new array for it
    dataObj[timestamp][name] = dataObj[timestamp][name] || []; 
    
    // add this count to the array
    dataObj[timestamp][name].push(count);
    

    If you get all the counts for a given timestamp/name pair at once, you can combine the last two statements into one:

    dataObj[timestamp][name] = countsArray;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm looking for a data structure that has the following properties. Stores a list
We are looking to store transactional data in SharePoint lists. The lists will easily
I'm looking for [free] server software to store hierarchal data efficiently. My key challenge
I'm looking for the following features: Scheduler uses SQL Server as the backing store
I have started to try APC to store some specific data on each webserver
I was asked the following Question: How would you store the data given below(which
I have the following data: var data = [ { id: 1, name: 'Ed
I have the following problem: I have to store in the database the data
I have two tables which have the exact same structure. Both tables can store
I am looking for a scheme-less database to store roughly 10[TB] of data on

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.