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

ObjectId, json-omitempty

    • Type: Icon: Bug Bug
    • Resolution: Gone away
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: 0.1.0
    • Component/s: JSON & ExtJSON
    • None

      E.g

      type Obj struct {
          SomeId objectid.ObjectID `bson:"listId,omitempty" json:"someId,omitempty"`
      }

      When an object is marshalled with SomeId ==  primitive.NilObjectID and omitempty tag, it shouldn't be included in the marshalled string.

      Now it's marshalled into

      {
         "someId: "00000000000000000000000"
      }

            Assignee:
            kris.brandow@mongodb.com Kristofer Brandow (Inactive)
            Reporter:
            david.mikus@flowup.cz Dávid Mikuš
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: