File tree 2 files changed +43
-1
lines changed
2 files changed +43
-1
lines changed Original file line number Diff line number Diff line change @@ -199,6 +199,48 @@ then you can write multiple arrays of necessary types in a dataset:
199
199
<1> first document array
200
200
<2> second document array
201
201
202
+ ### Nested documents
203
+
204
+ You can describe nested objects in your dataset.
205
+ Let's look at the the next model:
206
+
207
+ [source, java]
208
+ ----
209
+ @Data
210
+ @Document
211
+ public class FooBar {
212
+ @Id
213
+ private String id;
214
+ private String data;
215
+ private Bar bar; <1>
216
+ }
217
+
218
+ @Data
219
+ @Document
220
+ public class Bar {
221
+ @Id
222
+ private String id;
223
+ private String data;
224
+ }
225
+ ----
226
+ <1> nested object with another type
227
+
228
+ so, you can describe a dataset for this example as shown below:
229
+
230
+ [source, json]
231
+ ----
232
+ {
233
+ "com.jupiter.tools.spring.test.mongo.FooBar" : [ {
234
+ "id": "55f1dd90a1246a44e118300b",
235
+ "data" : "TOP LEVEL DATA",
236
+ "bar": {
237
+ "id": "88f3ed00b1375a48e619900c",
238
+ "data":"NESTED DATA"
239
+ }
240
+ }]
241
+ }
242
+ ----
243
+
202
244
### Date and time in dataset
203
245
204
246
To set a date and time value in a field you can use
Original file line number Diff line number Diff line change 5
5
6
6
<groupId >com.antkorwin</groupId >
7
7
<artifactId >spring-test-mongo</artifactId >
8
- <version >0.12-SNAPSHOT </version >
8
+ <version >0.12</version >
9
9
<packaging >jar</packaging >
10
10
11
11
<name >spring-test-mongo</name >
You can’t perform that action at this time.
0 commit comments