cant understand Arduinojson library to save something in flash

hello everybody....
Arduinojson is giving me real hard time....it been almost a week,since i started thinking and jerking around with this library.....i just cant understand any of its examples completely.......what i want it to be used for is,that i have to store data into flash as json,the data, you may ask,data is gonna come from client via wifi....but that is easy...i want to store some numbers repeatedly while getting incremented....i tried to get on website and youtube channel of author....i find his content less helping and more marketing to buy his book,therefore pushing his library to secrecy......
here's the example which i expect to understand and use to store content in flash
every attempt to help me is highly appreciated and worshipped

// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2018
// MIT License
//
// This example shows the different ways you can use Flash strings with
// ArduinoJson.
//
// Use Flash strings sparingly, because ArduinoJson duplicates them in the
// JsonBuffer. Prefer plain old char*, as they are more efficient in term of
// code size, speed, and memory usage.

#include <ArduinoJson.h>

void setup() {
  Serial.begin(9600);
#ifdef PROGMEM  // <- check that Flash strings are supported

  DynamicJsonBuffer jsonBuffer;

  // You can use a Flash String as your JSON input.
  // WARNING: the content of the Flash String will be duplicated in the
  // JsonBuffer.
  JsonObject& root =
      jsonBuffer.parseObject(F("{\"sensor\":\"gps\",\"time\":1351824120,"
                               "\"data\":[48.756080,2.302038]}"));

  // You can use a Flash String to get an element of a JsonObject
  // No duplication is done.
  long time = root[F("time")];

  // You can use a Flash String to set an element of a JsonObject
  // WARNING: the content of the Flash String will be duplicated in the
  // JsonBuffer.
  root[F("time")] = time;

  // You can set a Flash String to a JsonObject or JsonArray:
  // WARNING: the content of the Flash String will be duplicated in the
  // JsonBuffer.
  root["sensor"] = F("gps");

  // It works with RawJson too:
  root["sensor"] = RawJson(F("\"gps\""));

  // You can compare the content of a JsonVariant to a Flash String
  if (root["sensor"] == F("gps")) {
    // ...
  }

#else

#warning PROGMEM is not supported on this platform

#endif
}

void loop() {
  // not used in this example
  Serial.println("asfdsf");
}

// See also
// --------
//
// https://arduinojson.org/ contains the documentation for all the functions
// used above. It also includes an FAQ that will help you solve any memory
// problem.
//
// The book "Mastering ArduinoJson" contains a quick C++ course that explains
// how your microcontroller stores strings in memory. It also tells why you
// should not abuse Flash strings with ArduinoJson.
// Learn more at https://arduinojson.org/book/
// Use the coupon code TWENTY for a 20% discount ❤❤❤❤❤

If you are receiving data from Wifi, you can't store these values in Flash. Your program can only read flash memory. Depending on the size of the data you wish to store, look into using the onboard EEPROM and its library.

:o :o
what??
i stored a lot of data into flash which came from wifi.....using eeprom......if our device can read from flash,what will it read if nothing was written to it.......also dosent wifimanager library store wifi credentals into flash and then read 'em again and again......i think theres something i didnt understand,could you please elaborate.....thanks for your reply

WiFi manager stores values in standard memory using malloc().

Flash memory refers to the program memory where your code is stored. It is programmed when you upload your sketch by the build-in bootloader code on the chip. Writing to flash (program) memory is done in blocks, not like individual variables.

The chip also has EEPROM which you can read/write and those values will be retained across power cycles.

Look at the datasheet for the atmel 328 chip

oh ya.....i am using nodeMCU,which dosent have eeprom,but flash is used via eeprom library......
and what is "standard memory".....is it any different from flash....
also, many tutorials suggest that arduino json is stored in flash...anyways,dosent matter where it gets stored ...all i want is ...i want to store bulks of data anywhere other than sd card...thanks for your replies

With an ESP8266-based board, you should consider using SPIFFS.

why not the example i uploaded

I don't see where in that code that data is being programmatically stored to Flash during run-time. Did you not post that part?

cool....this gives me a reason to call myself a moron.....that code is complete...and is an inbuilt example in my ide.....since i dont understand even a single line from arduinojson thing,i dont even know if this example saves the data in flash......... i now used another way to store data,i will post the code here....but i just cant understand if it is using all the 4 mbytes of my board.

#include <FS.h> //spiff file system

void setup() {
  Serial.begin(115200);
  Serial.println("Starting...");
  SPIFFS.begin();
}
int data;
void loop() {
  // Assign a file name e.g. 'names.dat' or 'data.txt' or 'data.dat' try to use the 8.3 file naming convention format could be 'data.d'
  char filename [] = "datalog.txt";                     // Assign a filename or use the format e.g. SD.open("datalog.txt",...);
//
//  if (SPIFFS.exists(filename)) SPIFFS.remove(filename); // First in this example check to see if a file already exists, if so delete it

  File myDataFile = SPIFFS.open(filename, "a+");        // Open a file for reading and writing (appending)
  if (!myDataFile)Serial.println("file open failed");   // Check for errors
 
//  myDataFile.println("this is the "+String(data)+"\'th test");
  data++;
//   Write some data to it (26-characters)
  myDataFile.println("this aint no beta tedt");
  Serial.println(myDataFile.size());                    // Display the file size (26 characters + 4-byte floating point number + 6 termination bytes (2/line) = 34 bytes)
  myDataFile.close();                                   // Close the file

   myDataFile = SPIFFS.open(filename, "r");              // Open the file again, this time for reading
  if (!myDataFile) Serial.println("file open failed");  // Check for errors
  while (myDataFile.available()) {
    Serial.write(myDataFile.read());                    // Read all the data from the file and display it
  }
  myDataFile.close();                                   // Close the file
  delay(10000);                                         // wait and then do it all again
}

indeed spiffs it is...as u suggested