Decode at struct sub level won't working

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • None
    • Affects Version/s: 1.3.1, 1.3.2
    • Component/s: CRUD
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      At my struct have a sub level of document example

      type (  A struct {    ID  primitive.ObjectID `bson:"_id,omitempty"`    Title string `bson:"title"  }  B struct {     ID primitive.ObjectID `bson:"_id,omitempty"`     Title string `bson:"title"  }  C struct {     A     Bs []B `bson:"b"`  })

      when fetch data and decode data to struct C all of field return nil or empty
      but if i setup struct have all of field such as 

      type (
       C struct {
          ID primitive.ObjectID `bson:"_id,omitempty"` 
          Title string `bson:"title"
          Bs []struct{
             ID primitive.ObjectID `bson:"_id,omitempty"`
             Title string `bson:"title"
          } `bson:"b"`
       }
      )
      

      data return correctly 

      how to fix this problem or this is bug?

      thank you.

              Assignee:
              Divjot Arora (Inactive)
              Reporter:
              Thanakrit Nawasaykaew
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: