File tree Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -53,8 +53,11 @@ void loop() {
53
53
JsonObject& data = jsonBuffer.createObject();
54
54
JsonObject& nestedInsertion = data.createNestedObject("[email protected] ");
55
55
nestedInsertion["age"] = 22;
56
+
56
57
// Auto create non-existent fields
57
- data["auto-create-fields"] = true;
58
+ JsonArray& autoCreate = data.createNestedArray("auto-create");
59
+ autoCreate.add("table");
60
+ autoCreate.add("column");
58
61
59
62
// Insert object
60
63
sd.insert(data);
@@ -123,8 +126,11 @@ void loop() {
123
126
JsonObject& data = jsonBuffer.createObject();
124
127
JsonObject& nestedInsertion = data.createNestedObject("[email protected] ");
125
128
nestedInsertion["age"] = 22;
129
+
126
130
// Auto create non-existent fields
127
- data["auto-create-fields"] = true;
131
+ JsonArray& autoCreate = data.createNestedArray("auto-create");
132
+ autoCreate.add("table");
133
+ autoCreate.add("column");
128
134
129
135
// Insert object
130
136
sd.insert(data);
Original file line number Diff line number Diff line change @@ -28,7 +28,12 @@ void loop() {
28
28
JsonObject& insertion = jsonBuffer.createObject ();
29
29
JsonObject& nestedQueryInsertion = insertion.
createNestedObject (
" [email protected] " );
30
30
nestedQueryInsertion[" age" ] = 22 ;
31
- insertion[" auto-create-fields" ] = true ;
31
+
32
+ // Auto create non-existent fields
33
+ JsonArray& autoCreate = insertion.createNestedArray (" auto-create" );
34
+ autoCreate.add (" table" );
35
+ autoCreate.add (" column" );
36
+
32
37
sd.insert (insertion);
33
38
Serial.print (" Status code: " );
34
39
Serial.println (sd.statusCode );
You can’t perform that action at this time.
0 commit comments