# Ways for readRecords() to only request specific column?

**URL:** <https://forum.code.org/t/ways-for-readrecords-to-only-request-specific-column/32640>\
**Category:** Coding and Debugging Help\
**Created:** [May 7, 2020, 5:27am UTC](https://forum.code.org/t/ways-for-readrecords-to-only-request-specific-column/32640 "2020-05-07T05:27:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![i15904503668i](https://avatars.discourse-cdn.com/v4/letter/i/90db22/32.png) [@i15904503668i](https://forum.code.org/u/i15904503668i)\
**Post date:** [May 7, 2020, 5:27am UTC](https://forum.code.org/t/ways-for-readrecords-to-only-request-specific-column/32640/1 "2020-05-07T05:27:46Z")

</div>

One of my student is dealing with a particularly big data set and the program behaves weird when the connection is unstable - Probably because the readRecords() is not finished due to the absolute massive heap of data. She’s wondering if there’s a way for readRecords() to only request specific column of a data table so that the program would require less bandwidth and time to load.

So… requesting the entire list then sorting it locally is not what she’s looking for - as the goal is to reduce traffic.

---

<div class="post-metadata">

**Author:** ![jdonwells](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/jdonwells/32/7900_2.png) [@jdonwells](https://forum.code.org/u/jdonwells)\
**Post date:** [May 8, 2020, 10:23pm UTC](https://forum.code.org/t/ways-for-readrecords-to-only-request-specific-column/32640/2 "2020-05-08T22:23:02Z")

</div>

`readRecords()` returns JSON objects. You cannot get part of a JSON object from the database.

What you can do is only request a few objects at a time. The second parameter to `readRecords()` is an object that filters by exact match. So let’s say you have a database with a color column. You could request a subset of records by passing in {color: “red”}. Then you can work with a subset of the data at one time. The more specific you can be about which records you need the smaller the dataset. You cannot of course do that with numeric data only enumerations.

Another technique that might be good for numeric data is with really large datasets there is usually a summary that is more usable. So as you are putting data into your database you can create or update a few summary records that you can recall and use later instead of trying to work with the detailed dataset.

Working with large data with limited computing power is a current topic that your student can think about and research online.

---

<div class="post-metadata">

**Author:** ![i15904503668i](https://avatars.discourse-cdn.com/v4/letter/i/90db22/32.png) [@i15904503668i](https://forum.code.org/u/i15904503668i)\
**Post date:** [May 10, 2020, 9:03am UTC](https://forum.code.org/t/ways-for-readrecords-to-only-request-specific-column/32640/4 "2020-05-10T09:03:16Z")

</div>

Thanks you so much! I will forward this along 🙂
