Storing JSON fields

I have a plan to migrate my app to Strapi. The app sores prices of assets in JSON format and currently it is using the MongoDB as a database.
Now I have some questions about JSON fields:

  1. Does the Strapi stores a JSON field in a separate .JSON file or it stores the field in database?
  2. I mean does requesting and editing a heavy stored JSON fields can affect on database performance?
  3. If it stores the field’s data in database, does it stores JSON data as a serialized string in database?
  4. Assume that I have a JSON field that contains an array of daily prices in 10 years. Does Strapi has an ability to take the last value in the prices array and editing it without touching the whole array data?
  1. Use the JSON field type, this is stored in the Db Configuring fields for content-types | Strapi Documentation
  2. It’s stored as a string
  3. Yes
  4. You can write a custom method within Strapi to do this as part of middleware or as a custom plugin or as a hook. You’d probably leverage lodash to do whatever you needed. It may be wiser to create the JSON output as a collection type, and store your data in the database to be accessed with the API, rather than dumping data into a single field. You could then ingest and mutate the data response to do whatever you needed on both inputs and outputs of data if it’s coming from a third party.
1 Like