Uploaded image for project: 'Go Driver'
  1. Go Driver
  2. GODRIVER-1305

Allow inline fields to be pointers of struct

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • 1.1.1
    • 1.2.0
    • BSON, CRUD
    • None

    Description

      Instant of Stock cannot be written because a pointer of Quantity struct is used inside it.
      type Quantity struct {
          InCarton float64 `json:"InCarton" bson:"InCarton"`
          InPallet float64 `json:"InPallet" bson:"InPallet"`
          InKg float64 `json:"InKg" bson:"InKg"`
          InCBM float64 `json:"InCBM" bson:"InCBM"`

      type Stock struct {
          Batch `json:",inline" bson:",inline"`
          Quantity *Quantity `json:",inline" bson:",inline"`
          MovementHistory Movements `json:"MovementHistory" bson:"MovementHistory"`
          CostPerKg `json:"" bson:""`

      Error message is described as below:

      panic: cannot transform type *simcel.TransportOrderLine to a BSON Document: (struct simcel.Stock) inline fields must be either a struct or a map

      Attachments

        Activity

          People

            isabella.siu@mongodb.com Isabella Siu (Inactive)
            phuong.nguyen@cel-consulting.com Nguyen Phuong
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: