Home > Mobile >  JSON doesn't support the Schema of POST MongoDB and POSTMAN
JSON doesn't support the Schema of POST MongoDB and POSTMAN

Time:10-12

Object {
"VariableRep": Array [
"101-1",
"101-2",
"101-3",
"102-1",
"102-2",
"102-3",
"201-1",
"201-2",
"201-3",
"202-1",
"202-2",
"202-3",
],
"dateObservation": "2020/8/12
",
"essaiParcelle": "key1",
 "microParcelle": Array [
"101",
"102",
"201",
"202",
],
 "nameSerie": "Assess",
 "nbRepetition": "3",
 "variablesUnique": Array [
 Object {
  "id": 2,
  "title": "Carence en bore - % de surface parcellaire touchée",
  },
  ],
   }

The json I get does not insert into the postman I have to delete and modify some words like Array and commas

Is there a method to insert this json document on POSTMAN correctly a method to convert or a code generator on react automatically?

thanks

screen from red error

CodePudding user response:

console.log does not output JSON, it outputs a human-readable, interactive, display of the contents of a variable. It is not intended for this purpose, and converting its output to JSON is going about things the wrong way.

To produce JSON using JavaScript, you can use the JSON.stringify function.

  • Related