[GODRIVER-362] why the spring-data-MongoDB support is not fetch all nested child records with data? Created: 12/Apr/18  Updated: 12/Apr/18  Resolved: 12/Apr/18

Status: Closed
Project: Go Driver
Component/s: CRUD
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Pandiyan Rengasamy Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

I have MongoDB Collection like follow

MongoDB JSON:

{
"_id" : "1",
"_class" : "com.AColl",
"BColDate" :

{ "BName" : "xx", "BFirstName" : "97908", "BList" : [] }

,
"CCollList" : [
{
"CId" : "1",
"Cname" : "abc"
"CList" : [

{ "S" : "N", "Value1" : "", "Val2" : "qq", "Val3" : "ww1" }

],
"addres1" : "",
"status" : false
},
{
"CId" : "2",
"Cname" : "abc"
"CList" : [

{ "S" : "N", "Value1" : "", "Val2" : "qq", "Val3" : "ww1" }

],
"addres1" : "",
"status" : false
},
{
"CId" : "3",
"Cname" : "abc"
"CList" : [

{ "S" : "N", "Value1" : "", "Val2" : "qq", "Val3" : "ww1" }

],
"addres1" : "",
"status" : false
}
]
}

Java PoJo:

@Document(collection="test")
class Test implements Serializable

{ private static final long serialVersionUID = 1L; @Id @Indexed private String id; @Field("bbcoll") private BColl bbcoll; @Field("CCollList") private List<CCollList> CCollList; }

class BColl implements Serializable

{ private String BName; private String BFirstName; private List<BList> bList; }

class CCollList implements Serializable

{ private String CId; private String CName; private List<CList> bList; }

class CList implements Serializable

{ private String S; private String Value1; private String Value2; private String Value3; }

Java Code - Spring Data MongoDB query:

Test col = mongoOperation.findOne(query, Test.class);

MongoDB Response:

{
"_id" : "1",
"_class" : "com.AColl",
"BColDate" :

{ "BName" : "xx", "BFirstName" : "97908", "BList" : [] }

,
"CCollList" : [
{
"CId" : "1",
"Cname" : "abc"
"CList" : [

{ "S" : "N", "Value1" : "", "Val2" : "qq", "Val3" : "ww1" }

],
"addres1" : "",
"status" : false
},
{
"CId" : "2",
"Cname" : "abc"
"CList" : [

{ "S" : null, "Value1" : null, "Val2" : null, "Val3" : null }

],
"addres1" : "",
"status" : false
},
{
"CId" : "3",
"Cname" : "abc"
"CList" : [

{ "S" : null, "Value1" : null, "Val2" : null, "Val3" : null }

],
"addres1" : "",
"status" : false
}
]
}

Query:

When I try to iterate the CList object value for the "Cid" =2/3/1 and the MongoDB collections list values are null but in MongoDB the values are existed (as per json) and list object are not null.

**Why this issue in spring-date-mongoDB (version 1.9)?
otherwise, please let me know that this issue identified earlier?**

I really appreciate your help.

Thanks and Regards,
Pandiyan Rengasamy


Generated at Thu Feb 08 08:34:03 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.