File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 72
72
//
73
73
// Structs
74
74
//
75
- // Structs can be marshalled/unmarshalled to/from BSON. When transforming structs to/from BSON, the following rules
76
- // apply:
75
+ // Structs can be marshalled/unmarshalled to/from BSON or Extended JSON . When transforming structs to/from BSON or Extended
76
+ // JSON, the following rules apply:
77
77
//
78
78
// 1. Only exported fields in structs will be marshalled or unmarshalled.
79
79
//
89
89
// 5. When unmarshalling, a field of type interface{} will follow the D/M type mappings listed above. BSON documents
90
90
// unmarshalled into an interface{} field will be unmarshalled as a D.
91
91
//
92
- // The following struct tags can be used to configure behavior:
92
+ // The encoding of each struct field can be customized by the "bson" struct tag.
93
+ // The tag gives the name of the field, possibly followed by a comma-separated list of options.
94
+ // The name may be empty in order to specify options without overriding the default field name. The following options can be used
95
+ // to configure behavior:
93
96
//
94
97
// 1. omitempty: If the omitempty struct tag is specified on a field, the field will not be marshalled if it is set to
95
98
// the zero value. By default, a struct field is only considered empty if the field's type implements the Zeroer
You can’t perform that action at this time.
0 commit comments