@@ -10,125 +10,167 @@ import (
10
10
"go.mongodb.org/mongo-driver/bson"
11
11
)
12
12
13
- // IndexOptionsBuilder is deprecated and unused. Use mongo/options.IndexOptions instead.
13
+ // IndexOptionsBuilder specifies options for a new index.
14
+ //
15
+ // Deprecated: Use the IndexOptions type in the mongo/options package instead.
14
16
type IndexOptionsBuilder struct {
15
17
document bson.D
16
18
}
17
19
18
- // NewIndexOptionsBuilder is deprecated.
20
+ // NewIndexOptionsBuilder creates a new IndexOptionsBuilder.
21
+ //
22
+ // Deprecated: Use the Index function in mongo/options instead.
19
23
func NewIndexOptionsBuilder () * IndexOptionsBuilder {
20
24
return & IndexOptionsBuilder {}
21
25
}
22
26
23
- // Background is deprecated.
27
+ // Background specifies a value for the background option.
28
+ //
29
+ // Deprecated: Use the IndexOptions.SetBackground function in mongo/options instead.
24
30
func (iob * IndexOptionsBuilder ) Background (background bool ) * IndexOptionsBuilder {
25
31
iob .document = append (iob .document , bson.E {"background" , background })
26
32
return iob
27
33
}
28
34
29
- // ExpireAfterSeconds is deprecated.
35
+ // ExpireAfterSeconds specifies a value for the expireAfterSeconds option.
36
+ //
37
+ // Deprecated: Use the IndexOptions.SetExpireAfterSeconds function in mongo/options instead.
30
38
func (iob * IndexOptionsBuilder ) ExpireAfterSeconds (expireAfterSeconds int32 ) * IndexOptionsBuilder {
31
39
iob .document = append (iob .document , bson.E {"expireAfterSeconds" , expireAfterSeconds })
32
40
return iob
33
41
}
34
42
35
- // Name is deprecated.
43
+ // Name specifies a value for the name option.
44
+ //
45
+ // Deprecated: Use the IndexOptions.SetName function in mongo/options instead.
36
46
func (iob * IndexOptionsBuilder ) Name (name string ) * IndexOptionsBuilder {
37
47
iob .document = append (iob .document , bson.E {"name" , name })
38
48
return iob
39
49
}
40
50
41
- // Sparse is deprecated.
51
+ // Sparse specifies a value for the sparse option.
52
+ //
53
+ // Deprecated: Use the IndexOptions.SetSparse function in mongo/options instead.
42
54
func (iob * IndexOptionsBuilder ) Sparse (sparse bool ) * IndexOptionsBuilder {
43
55
iob .document = append (iob .document , bson.E {"sparse" , sparse })
44
56
return iob
45
57
}
46
58
47
- // StorageEngine is deprecated.
59
+ // StorageEngine specifies a value for the storageEngine option.
60
+ //
61
+ // Deprecated: Use the IndexOptions.SetStorageEngine function in mongo/options instead.
48
62
func (iob * IndexOptionsBuilder ) StorageEngine (storageEngine interface {}) * IndexOptionsBuilder {
49
63
iob .document = append (iob .document , bson.E {"storageEngine" , storageEngine })
50
64
return iob
51
65
}
52
66
53
- // Unique is deprecated.
67
+ // Unique specifies a value for the unique option.
68
+ //
69
+ // Deprecated: Use the IndexOptions.SetUnique function in mongo/options instead.
54
70
func (iob * IndexOptionsBuilder ) Unique (unique bool ) * IndexOptionsBuilder {
55
71
iob .document = append (iob .document , bson.E {"unique" , unique })
56
72
return iob
57
73
}
58
74
59
- // Version is deprecated.
75
+ // Version specifies a value for the version option.
76
+ //
77
+ // Deprecated: Use the IndexOptions.SetVersion function in mongo/options instead.
60
78
func (iob * IndexOptionsBuilder ) Version (version int32 ) * IndexOptionsBuilder {
61
79
iob .document = append (iob .document , bson.E {"v" , version })
62
80
return iob
63
81
}
64
82
65
- // DefaultLanguage is deprecated.
83
+ // DefaultLanguage specifies a value for the default_language option.
84
+ //
85
+ // Deprecated: Use the IndexOptions.SetDefaultLanguage function in mongo/options instead.
66
86
func (iob * IndexOptionsBuilder ) DefaultLanguage (defaultLanguage string ) * IndexOptionsBuilder {
67
87
iob .document = append (iob .document , bson.E {"default_language" , defaultLanguage })
68
88
return iob
69
89
}
70
90
71
- // LanguageOverride is deprecated.
91
+ // LanguageOverride specifies a value for the language_override option.
92
+ //
93
+ // Deprecated: Use the IndexOptions.SetLanguageOverride function in mongo/options instead.
72
94
func (iob * IndexOptionsBuilder ) LanguageOverride (languageOverride string ) * IndexOptionsBuilder {
73
95
iob .document = append (iob .document , bson.E {"language_override" , languageOverride })
74
96
return iob
75
97
}
76
98
77
- // TextVersion is deprecated.
99
+ // TextVersion specifies a value for the textIndexVersion option.
100
+ //
101
+ // Deprecated: Use the IndexOptions.SetTextVersion function in mongo/options instead.
78
102
func (iob * IndexOptionsBuilder ) TextVersion (textVersion int32 ) * IndexOptionsBuilder {
79
103
iob .document = append (iob .document , bson.E {"textIndexVersion" , textVersion })
80
104
return iob
81
105
}
82
106
83
- // Weights is deprecated.
107
+ // Weights specifies a value for the weights option.
108
+ //
109
+ // Deprecated: Use the IndexOptions.SetWeights function in mongo/options instead.
84
110
func (iob * IndexOptionsBuilder ) Weights (weights interface {}) * IndexOptionsBuilder {
85
111
iob .document = append (iob .document , bson.E {"weights" , weights })
86
112
return iob
87
113
}
88
114
89
- // SphereVersion is deprecated.
115
+ // SphereVersion specifies a value for the 2dsphereIndexVersion option.
116
+ //
117
+ // Deprecated: Use the IndexOptions.SetSphereVersion function in mongo/options instead.
90
118
func (iob * IndexOptionsBuilder ) SphereVersion (sphereVersion int32 ) * IndexOptionsBuilder {
91
119
iob .document = append (iob .document , bson.E {"2dsphereIndexVersion" , sphereVersion })
92
120
return iob
93
121
}
94
122
95
- // Bits is deprecated.
123
+ // Bits specifies a value for the bits option.
124
+ //
125
+ // Deprecated: Use the IndexOptions.SetBits function in mongo/options instead.
96
126
func (iob * IndexOptionsBuilder ) Bits (bits int32 ) * IndexOptionsBuilder {
97
127
iob .document = append (iob .document , bson.E {"bits" , bits })
98
128
return iob
99
129
}
100
130
101
- // Max is deprecated.
131
+ // Max specifies a value for the max option.
132
+ //
133
+ // Deprecated: Use the IndexOptions.SetMax function in mongo/options instead.
102
134
func (iob * IndexOptionsBuilder ) Max (max float64 ) * IndexOptionsBuilder {
103
135
iob .document = append (iob .document , bson.E {"max" , max })
104
136
return iob
105
137
}
106
138
107
- // Min is deprecated.
139
+ // Min specifies a value for the min option.
140
+ //
141
+ // Deprecated: Use the IndexOptions.SetMin function in mongo/options instead.
108
142
func (iob * IndexOptionsBuilder ) Min (min float64 ) * IndexOptionsBuilder {
109
143
iob .document = append (iob .document , bson.E {"min" , min })
110
144
return iob
111
145
}
112
146
113
- // BucketSize is deprecated.
147
+ // BucketSize specifies a value for the bucketSize option.
148
+ //
149
+ // Deprecated: Use the IndexOptions.SetBucketSize function in mongo/options instead.
114
150
func (iob * IndexOptionsBuilder ) BucketSize (bucketSize int32 ) * IndexOptionsBuilder {
115
151
iob .document = append (iob .document , bson.E {"bucketSize" , bucketSize })
116
152
return iob
117
153
}
118
154
119
- // PartialFilterExpression is deprecated.
155
+ // PartialFilterExpression specifies a value for the partialFilterExpression option.
156
+ //
157
+ // Deprecated: Use the IndexOptions.SetPartialFilterExpression function in mongo/options instead.
120
158
func (iob * IndexOptionsBuilder ) PartialFilterExpression (partialFilterExpression interface {}) * IndexOptionsBuilder {
121
159
iob .document = append (iob .document , bson.E {"partialFilterExpression" , partialFilterExpression })
122
160
return iob
123
161
}
124
162
125
- // Collation is deprecated.
163
+ // Collation specifies a value for the collation option.
164
+ //
165
+ // Deprecated: Use the IndexOptions.SetCollation function in mongo/options instead.
126
166
func (iob * IndexOptionsBuilder ) Collation (collation interface {}) * IndexOptionsBuilder {
127
167
iob .document = append (iob .document , bson.E {"collation" , collation })
128
168
return iob
129
169
}
130
170
131
- // Build is deprecated.
171
+ // Build finishes constructing an the builder.
172
+ //
173
+ // Deprecated: Use the IndexOptions type in the mongo/options package instead.
132
174
func (iob * IndexOptionsBuilder ) Build () bson.D {
133
175
return iob .document
134
176
}
0 commit comments