how many key value pairs an object can handle?

Madhvesh S

I've 3 million lead objects and 5 thousand program objects, which will be mapped together using program activity, hence a lead object will have multiple program objects. So my question is can I store 3 million leads holding their programs in a single object?

eg:

{
     "lead78354": {
         "First Name": "test",
         "Last Name": "test",
         "Id": "78354",
         "Email Address": "[email protected]",
         "FirstLeadSource": "null",
         "leadStatus": "Qualified",
         "country": "US",
         "SEInferredCountry": "null",
         "LastProgramSuccess": "null",
         "HistoryOfProgramSuccesses": "Dec 14, 2017 : US_All_Contact_Sale",
         "programs": {
             "program1": {
                 "id": 1324,
                 "description": "•\tContent selection  LP & TY",
                 "createdAt": "2015-02-27T15:18:31Z+0000",
                 "updatedAt": "2017-12-17T15:09:39Z+0000",
                 "type": "Default",
                 "channel": "Content",
                 "folder": {
                     "type": "Folder",
                     "value": 7685,
                     "folderName": "US Country Pages"
                 },
                 "status": "",
                 "workspace": "NAM",
                 "tags": [{
                     "tagType": "Marketing Campaign",
                     "tagValue": "EcoBuildings"
                 }, {
                     "tagType": "Primary Business",
                     "tagValue": "All Business Units"
                 }, {
                     "tagType": "Primary Country",
                     "tagValue": "US"
                 }, {
                     "tagType": "Primary Market Segmentation",
                     "tagValue": "All Segments"
                 }],
                 "costs": []
             }
         }
     },
     lead2:{
            "test":"test"
            programs:{.......}
     }
   so on....
}
nixkuroi

Yes, you can. All you have to do is create an object and then add new objects with unique IDs. I've included a snippet below. The only constraint here seems to be your RAM.

var allobjects = {};
var sampleObj = {
         "First Name": "test",
         "Last Name": "test",
         "Id": "78354",
         "Email Address": "[email protected]",
         "FirstLeadSource": "null",
         "leadStatus": "Qualified",
         "country": "US",
         "SEInferredCountry": "null",
         "LastProgramSuccess": "null",
         "HistoryOfProgramSuccesses": "Dec 14, 2017 : US_All_Contact_Sale",
         "programs": {
             "program1": {
                 "id": 1324,
                 "description": "•\tContent selection  LP & TY",
                 "createdAt": "2015-02-27T15:18:31Z+0000",
                 "updatedAt": "2017-12-17T15:09:39Z+0000",
                 "type": "Default",
                 "channel": "Content",
                 "folder": {
                     "type": "Folder",
                     "value": 7685,
                     "folderName": "US Country Pages"
                 },
                 "status": "",
                 "workspace": "NAM",
                 "tags": [{
                     "tagType": "Marketing Campaign",
                     "tagValue": "EcoBuildings"
                 }, {
                     "tagType": "Primary Business",
                     "tagValue": "All Business Units"
                 }, {
                     "tagType": "Primary Country",
                     "tagValue": "US"
                 }, {
                     "tagType": "Primary Market Segmentation",
                     "tagValue": "All Segments"
                 }],
                 "costs": []
             }
         }
     };
     
 for (var i=0;i<3000000;i++) {
  allobjects[("lead"+i)]=Object.create(sampleObj);
 }
 
 var count =0;
 for (var prop in allobjects) {
 count++;
 }
 console.log("lead count: " + count);

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How to fill a Javascript object literal with many static key/value pairs efficiently?

How to convert string into object with key value pairs

How many number of key-value pairs in a map I can store in a Firestore document?

How can I create key-value pairs object where value is component?

Comparing two dictionaries and checking how many (key, value) pairs are equal

How to look through key/value pairs in object for specific key?

How can I query a table with key/value pairs into a JSON object using FOR JSON PATH?

How can I add only particular key value pairs from one object to another?

How can you map an array to a new array based on the key-value pairs in an object?

How can I create a new object that only contains the key/value pairs specified in an array?

How can I read all the key-value pairs in .ini file into an object?

How to get the three key/value pairs with the lowest value from an object?

Json object to key value pairs

Array of key/value pairs to object

Handle changeable key/value pairs in RestKit

How to add types for object with varying number of key/value pairs?

How to convert array to an object with key/value pairs Javascript

How to create an object from an Array of key-value pairs?

How to convert an Object {} to an Array [] of key-value pairs in JavaScript

How to convert an Object {} to an Array [] of key-value pairs in JavaScript

How to convert an array into an object in javascript with mapped key-value pairs?

How to convert an array of nested objects to an object with key, value pairs in JavaScript

How to dynamically add key value pairs in Kotlin object?

How to get certain key value pairs from an array of object

How to parse an objects with array index to object array with key value pairs

How to push all key/value pairs to object from forEach

how to split a js object into an array of key-value pairs?

How to print out all key value pairs of an object

How to turn 2 arrays into an object with key value pairs