-
Notifications
You must be signed in to change notification settings - Fork 5
/
model_index_options.go
768 lines (654 loc) · 25.4 KB
/
model_index_options.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
// Code based on the AtlasAPI V2 OpenAPI file
package admin
import (
"encoding/json"
)
// IndexOptions One or more settings that determine how the MongoDB Cloud creates this MongoDB index.
type IndexOptions struct {
// Index version number applied to the 2dsphere index. MongoDB 3.2 and later use version 3. Use this option to override the default version number. This option applies to the **2dsphere** index type only.
Var2dsphereIndexVersion *int `json:"2dsphereIndexVersion,omitempty"`
// Flag that indicates whether MongoDB should build the index in the background. This applies to MongoDB databases running feature compatibility version 4.0 or earlier. MongoDB databases running FCV 4.2 or later build indexes using an optimized build process. This process holds the exclusive lock only at the beginning and end of the build process. The rest of the build process yields to interleaving read and write operations. MongoDB databases running FCV 4.2 or later ignore this option. This option applies to all index types.
Background *bool `json:"background,omitempty"`
// Number of precision applied to the stored geohash value of the location data. This option applies to the **2d** index type only.
Bits *int `json:"bits,omitempty"`
// Number of units within which to group the location values. You could group in the same bucket those location values within the specified number of units to each other. This option applies to the geoHaystack index type only. MongoDB 5.0 removed geoHaystack Indexes and the `geoSearch` command.
BucketSize *int `json:"bucketSize,omitempty"`
// The columnstoreProjection document allows to include or exclude subschemas schema. One cannot combine inclusion and exclusion statements. Accordingly, the <value> can be either of the following: 1 or true to include the field and recursively all fields it is a prefix of in the index 0 or false to exclude the field and recursively all fields it is a prefix of from the index.
ColumnstoreProjection *map[string]int `json:"columnstoreProjection,omitempty"`
// Human language that determines the list of stop words and the rules for the stemmer and tokenizer. This option accepts the supported languages using its name in lowercase english or the ISO 639-2 code. If you set this parameter to `\"none\"`, then the text search uses simple tokenization with no list of stop words and no stemming. This option applies to the **text** index type only.
DefaultLanguage *string `json:"default_language,omitempty"`
// Number of seconds that MongoDB retains documents in a Time To Live (TTL) index.
ExpireAfterSeconds *int `json:"expireAfterSeconds,omitempty"`
// Flag that determines whether the index is hidden from the query planner. A hidden index is not evaluated as part of the query plan selection.
Hidden *bool `json:"hidden,omitempty"`
// Human-readable label that identifies the document parameter that contains the override language for the document. This option applies to the **text** index type only.
LanguageOverride *string `json:"language_override,omitempty"`
// Upper inclusive boundary to limit the longitude and latitude values. This option applies to the 2d index type only.
Max *int `json:"max,omitempty"`
// Lower inclusive boundary to limit the longitude and latitude values. This option applies to the 2d index type only.
Min *int `json:"min,omitempty"`
// Human-readable label that identifies this index. This option applies to all index types.
Name *string `json:"name,omitempty"`
// Rules that limit the documents that the index references to a filter expression. All MongoDB index types accept a **partialFilterExpression** option. **partialFilterExpression** can include following expressions: - equality (`\"parameter\" : \"value\"` or using the `$eq` operator) - `\"$exists\": true` , maximum: `$gt`, `$gte`, `$lt`, `$lte` comparisons - `$type` - `$and` (top-level only) This option applies to all index types.
PartialFilterExpression map[string]interface{} `json:"partialFilterExpression,omitempty"`
// Flag that indicates whether the index references documents that only have the specified parameter. These indexes use less space but behave differently in some situations like when sorting. The following index types default to sparse and ignore this option: `2dsphere`, `2d`, `geoHaystack`, `text`. Compound indexes that includes one or more indexes with `2dsphere` keys alongside other key types, only the `2dsphere` index parameters determine which documents the index references. If you run MongoDB 3.2 or later, use partial indexes. This option applies to all index types.
Sparse *bool `json:"sparse,omitempty"`
// Storage engine set for the specific index. This value can be set only at creation. This option uses the following format: `\"storageEngine\" : { \"<storage-engine-name>\" : \"<options>\" }` MongoDB validates storage engine configuration options when creating indexes. To support replica sets with members with different storage engines, MongoDB logs these options to the oplog during replication. This option applies to all index types.
StorageEngine map[string]interface{} `json:"storageEngine,omitempty"`
// Version applied to this text index. MongoDB 3.2 and later use version `3`. Use this option to override the default version number. This option applies to the **text** index type only.
TextIndexVersion *int `json:"textIndexVersion,omitempty"`
// Flag that indicates whether this index can accept insertion or update of documents when the index key value matches an existing index key value. Set `\"unique\" : true` to set this index as unique. You can't set a hashed index to be unique. This option applies to all index types. This option is unsupported for rolling indexes.
Unique *bool `json:"unique,omitempty"`
// Relative importance to place upon provided index parameters. This object expresses this as key/value pairs of index parameter and weight to apply to that parameter. You can specify weights for some or all the indexed parameters. The weight must be an integer between 1 and 99,999. MongoDB 5.0 and later can apply **weights** to **text** indexes only.
Weights map[string]interface{} `json:"weights,omitempty"`
}
// NewIndexOptions instantiates a new IndexOptions object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewIndexOptions() *IndexOptions {
this := IndexOptions{}
var var2dsphereIndexVersion int = 3
this.Var2dsphereIndexVersion = &var2dsphereIndexVersion
var background bool = false
this.Background = &background
var bits int = 26
this.Bits = &bits
var defaultLanguage string = "english"
this.DefaultLanguage = &defaultLanguage
var hidden bool = false
this.Hidden = &hidden
var languageOverride string = "language"
this.LanguageOverride = &languageOverride
var max int = 180
this.Max = &max
var min int = -180
this.Min = &min
var sparse bool = false
this.Sparse = &sparse
var textIndexVersion int = 3
this.TextIndexVersion = &textIndexVersion
var unique bool = false
this.Unique = &unique
return &this
}
// NewIndexOptionsWithDefaults instantiates a new IndexOptions object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewIndexOptionsWithDefaults() *IndexOptions {
this := IndexOptions{}
var var2dsphereIndexVersion int = 3
this.Var2dsphereIndexVersion = &var2dsphereIndexVersion
var background bool = false
this.Background = &background
var bits int = 26
this.Bits = &bits
var defaultLanguage string = "english"
this.DefaultLanguage = &defaultLanguage
var hidden bool = false
this.Hidden = &hidden
var languageOverride string = "language"
this.LanguageOverride = &languageOverride
var max int = 180
this.Max = &max
var min int = -180
this.Min = &min
var sparse bool = false
this.Sparse = &sparse
var textIndexVersion int = 3
this.TextIndexVersion = &textIndexVersion
var unique bool = false
this.Unique = &unique
return &this
}
// GetVar2dsphereIndexVersion returns the Var2dsphereIndexVersion field value if set, zero value otherwise
func (o *IndexOptions) GetVar2dsphereIndexVersion() int {
if o == nil || IsNil(o.Var2dsphereIndexVersion) {
var ret int
return ret
}
return *o.Var2dsphereIndexVersion
}
// GetVar2dsphereIndexVersionOk returns a tuple with the Var2dsphereIndexVersion field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IndexOptions) GetVar2dsphereIndexVersionOk() (*int, bool) {
if o == nil || IsNil(o.Var2dsphereIndexVersion) {
return nil, false
}
return o.Var2dsphereIndexVersion, true
}
// HasVar2dsphereIndexVersion returns a boolean if a field has been set.
func (o *IndexOptions) HasVar2dsphereIndexVersion() bool {
if o != nil && !IsNil(o.Var2dsphereIndexVersion) {
return true
}
return false
}
// SetVar2dsphereIndexVersion gets a reference to the given int and assigns it to the Var2dsphereIndexVersion field.
func (o *IndexOptions) SetVar2dsphereIndexVersion(v int) {
o.Var2dsphereIndexVersion = &v
}
// GetBackground returns the Background field value if set, zero value otherwise
func (o *IndexOptions) GetBackground() bool {
if o == nil || IsNil(o.Background) {
var ret bool
return ret
}
return *o.Background
}
// GetBackgroundOk returns a tuple with the Background field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IndexOptions) GetBackgroundOk() (*bool, bool) {
if o == nil || IsNil(o.Background) {
return nil, false
}
return o.Background, true
}
// HasBackground returns a boolean if a field has been set.
func (o *IndexOptions) HasBackground() bool {
if o != nil && !IsNil(o.Background) {
return true
}
return false
}
// SetBackground gets a reference to the given bool and assigns it to the Background field.
func (o *IndexOptions) SetBackground(v bool) {
o.Background = &v
}
// GetBits returns the Bits field value if set, zero value otherwise
func (o *IndexOptions) GetBits() int {
if o == nil || IsNil(o.Bits) {
var ret int
return ret
}
return *o.Bits
}
// GetBitsOk returns a tuple with the Bits field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IndexOptions) GetBitsOk() (*int, bool) {
if o == nil || IsNil(o.Bits) {
return nil, false
}
return o.Bits, true
}
// HasBits returns a boolean if a field has been set.
func (o *IndexOptions) HasBits() bool {
if o != nil && !IsNil(o.Bits) {
return true
}
return false
}
// SetBits gets a reference to the given int and assigns it to the Bits field.
func (o *IndexOptions) SetBits(v int) {
o.Bits = &v
}
// GetBucketSize returns the BucketSize field value if set, zero value otherwise
func (o *IndexOptions) GetBucketSize() int {
if o == nil || IsNil(o.BucketSize) {
var ret int
return ret
}
return *o.BucketSize
}
// GetBucketSizeOk returns a tuple with the BucketSize field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IndexOptions) GetBucketSizeOk() (*int, bool) {
if o == nil || IsNil(o.BucketSize) {
return nil, false
}
return o.BucketSize, true
}
// HasBucketSize returns a boolean if a field has been set.
func (o *IndexOptions) HasBucketSize() bool {
if o != nil && !IsNil(o.BucketSize) {
return true
}
return false
}
// SetBucketSize gets a reference to the given int and assigns it to the BucketSize field.
func (o *IndexOptions) SetBucketSize(v int) {
o.BucketSize = &v
}
// GetColumnstoreProjection returns the ColumnstoreProjection field value if set, zero value otherwise
func (o *IndexOptions) GetColumnstoreProjection() map[string]int {
if o == nil || IsNil(o.ColumnstoreProjection) {
var ret map[string]int
return ret
}
return *o.ColumnstoreProjection
}
// GetColumnstoreProjectionOk returns a tuple with the ColumnstoreProjection field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IndexOptions) GetColumnstoreProjectionOk() (*map[string]int, bool) {
if o == nil || IsNil(o.ColumnstoreProjection) {
return nil, false
}
return o.ColumnstoreProjection, true
}
// HasColumnstoreProjection returns a boolean if a field has been set.
func (o *IndexOptions) HasColumnstoreProjection() bool {
if o != nil && !IsNil(o.ColumnstoreProjection) {
return true
}
return false
}
// SetColumnstoreProjection gets a reference to the given map[string]int and assigns it to the ColumnstoreProjection field.
func (o *IndexOptions) SetColumnstoreProjection(v map[string]int) {
o.ColumnstoreProjection = &v
}
// GetDefaultLanguage returns the DefaultLanguage field value if set, zero value otherwise
func (o *IndexOptions) GetDefaultLanguage() string {
if o == nil || IsNil(o.DefaultLanguage) {
var ret string
return ret
}
return *o.DefaultLanguage
}
// GetDefaultLanguageOk returns a tuple with the DefaultLanguage field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IndexOptions) GetDefaultLanguageOk() (*string, bool) {
if o == nil || IsNil(o.DefaultLanguage) {
return nil, false
}
return o.DefaultLanguage, true
}
// HasDefaultLanguage returns a boolean if a field has been set.
func (o *IndexOptions) HasDefaultLanguage() bool {
if o != nil && !IsNil(o.DefaultLanguage) {
return true
}
return false
}
// SetDefaultLanguage gets a reference to the given string and assigns it to the DefaultLanguage field.
func (o *IndexOptions) SetDefaultLanguage(v string) {
o.DefaultLanguage = &v
}
// GetExpireAfterSeconds returns the ExpireAfterSeconds field value if set, zero value otherwise
func (o *IndexOptions) GetExpireAfterSeconds() int {
if o == nil || IsNil(o.ExpireAfterSeconds) {
var ret int
return ret
}
return *o.ExpireAfterSeconds
}
// GetExpireAfterSecondsOk returns a tuple with the ExpireAfterSeconds field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IndexOptions) GetExpireAfterSecondsOk() (*int, bool) {
if o == nil || IsNil(o.ExpireAfterSeconds) {
return nil, false
}
return o.ExpireAfterSeconds, true
}
// HasExpireAfterSeconds returns a boolean if a field has been set.
func (o *IndexOptions) HasExpireAfterSeconds() bool {
if o != nil && !IsNil(o.ExpireAfterSeconds) {
return true
}
return false
}
// SetExpireAfterSeconds gets a reference to the given int and assigns it to the ExpireAfterSeconds field.
func (o *IndexOptions) SetExpireAfterSeconds(v int) {
o.ExpireAfterSeconds = &v
}
// GetHidden returns the Hidden field value if set, zero value otherwise
func (o *IndexOptions) GetHidden() bool {
if o == nil || IsNil(o.Hidden) {
var ret bool
return ret
}
return *o.Hidden
}
// GetHiddenOk returns a tuple with the Hidden field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IndexOptions) GetHiddenOk() (*bool, bool) {
if o == nil || IsNil(o.Hidden) {
return nil, false
}
return o.Hidden, true
}
// HasHidden returns a boolean if a field has been set.
func (o *IndexOptions) HasHidden() bool {
if o != nil && !IsNil(o.Hidden) {
return true
}
return false
}
// SetHidden gets a reference to the given bool and assigns it to the Hidden field.
func (o *IndexOptions) SetHidden(v bool) {
o.Hidden = &v
}
// GetLanguageOverride returns the LanguageOverride field value if set, zero value otherwise
func (o *IndexOptions) GetLanguageOverride() string {
if o == nil || IsNil(o.LanguageOverride) {
var ret string
return ret
}
return *o.LanguageOverride
}
// GetLanguageOverrideOk returns a tuple with the LanguageOverride field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IndexOptions) GetLanguageOverrideOk() (*string, bool) {
if o == nil || IsNil(o.LanguageOverride) {
return nil, false
}
return o.LanguageOverride, true
}
// HasLanguageOverride returns a boolean if a field has been set.
func (o *IndexOptions) HasLanguageOverride() bool {
if o != nil && !IsNil(o.LanguageOverride) {
return true
}
return false
}
// SetLanguageOverride gets a reference to the given string and assigns it to the LanguageOverride field.
func (o *IndexOptions) SetLanguageOverride(v string) {
o.LanguageOverride = &v
}
// GetMax returns the Max field value if set, zero value otherwise
func (o *IndexOptions) GetMax() int {
if o == nil || IsNil(o.Max) {
var ret int
return ret
}
return *o.Max
}
// GetMaxOk returns a tuple with the Max field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IndexOptions) GetMaxOk() (*int, bool) {
if o == nil || IsNil(o.Max) {
return nil, false
}
return o.Max, true
}
// HasMax returns a boolean if a field has been set.
func (o *IndexOptions) HasMax() bool {
if o != nil && !IsNil(o.Max) {
return true
}
return false
}
// SetMax gets a reference to the given int and assigns it to the Max field.
func (o *IndexOptions) SetMax(v int) {
o.Max = &v
}
// GetMin returns the Min field value if set, zero value otherwise
func (o *IndexOptions) GetMin() int {
if o == nil || IsNil(o.Min) {
var ret int
return ret
}
return *o.Min
}
// GetMinOk returns a tuple with the Min field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IndexOptions) GetMinOk() (*int, bool) {
if o == nil || IsNil(o.Min) {
return nil, false
}
return o.Min, true
}
// HasMin returns a boolean if a field has been set.
func (o *IndexOptions) HasMin() bool {
if o != nil && !IsNil(o.Min) {
return true
}
return false
}
// SetMin gets a reference to the given int and assigns it to the Min field.
func (o *IndexOptions) SetMin(v int) {
o.Min = &v
}
// GetName returns the Name field value if set, zero value otherwise
func (o *IndexOptions) GetName() string {
if o == nil || IsNil(o.Name) {
var ret string
return ret
}
return *o.Name
}
// GetNameOk returns a tuple with the Name field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IndexOptions) GetNameOk() (*string, bool) {
if o == nil || IsNil(o.Name) {
return nil, false
}
return o.Name, true
}
// HasName returns a boolean if a field has been set.
func (o *IndexOptions) HasName() bool {
if o != nil && !IsNil(o.Name) {
return true
}
return false
}
// SetName gets a reference to the given string and assigns it to the Name field.
func (o *IndexOptions) SetName(v string) {
o.Name = &v
}
// GetPartialFilterExpression returns the PartialFilterExpression field value if set, zero value otherwise
func (o *IndexOptions) GetPartialFilterExpression() map[string]interface{} {
if o == nil || IsNil(o.PartialFilterExpression) {
var ret map[string]interface{}
return ret
}
return o.PartialFilterExpression
}
// GetPartialFilterExpressionOk returns a tuple with the PartialFilterExpression field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IndexOptions) GetPartialFilterExpressionOk() (map[string]interface{}, bool) {
if o == nil || IsNil(o.PartialFilterExpression) {
return map[string]interface{}{}, false
}
return o.PartialFilterExpression, true
}
// HasPartialFilterExpression returns a boolean if a field has been set.
func (o *IndexOptions) HasPartialFilterExpression() bool {
if o != nil && !IsNil(o.PartialFilterExpression) {
return true
}
return false
}
// SetPartialFilterExpression gets a reference to the given map[string]interface{} and assigns it to the PartialFilterExpression field.
func (o *IndexOptions) SetPartialFilterExpression(v map[string]interface{}) {
o.PartialFilterExpression = v
}
// GetSparse returns the Sparse field value if set, zero value otherwise
func (o *IndexOptions) GetSparse() bool {
if o == nil || IsNil(o.Sparse) {
var ret bool
return ret
}
return *o.Sparse
}
// GetSparseOk returns a tuple with the Sparse field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IndexOptions) GetSparseOk() (*bool, bool) {
if o == nil || IsNil(o.Sparse) {
return nil, false
}
return o.Sparse, true
}
// HasSparse returns a boolean if a field has been set.
func (o *IndexOptions) HasSparse() bool {
if o != nil && !IsNil(o.Sparse) {
return true
}
return false
}
// SetSparse gets a reference to the given bool and assigns it to the Sparse field.
func (o *IndexOptions) SetSparse(v bool) {
o.Sparse = &v
}
// GetStorageEngine returns the StorageEngine field value if set, zero value otherwise
func (o *IndexOptions) GetStorageEngine() map[string]interface{} {
if o == nil || IsNil(o.StorageEngine) {
var ret map[string]interface{}
return ret
}
return o.StorageEngine
}
// GetStorageEngineOk returns a tuple with the StorageEngine field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IndexOptions) GetStorageEngineOk() (map[string]interface{}, bool) {
if o == nil || IsNil(o.StorageEngine) {
return map[string]interface{}{}, false
}
return o.StorageEngine, true
}
// HasStorageEngine returns a boolean if a field has been set.
func (o *IndexOptions) HasStorageEngine() bool {
if o != nil && !IsNil(o.StorageEngine) {
return true
}
return false
}
// SetStorageEngine gets a reference to the given map[string]interface{} and assigns it to the StorageEngine field.
func (o *IndexOptions) SetStorageEngine(v map[string]interface{}) {
o.StorageEngine = v
}
// GetTextIndexVersion returns the TextIndexVersion field value if set, zero value otherwise
func (o *IndexOptions) GetTextIndexVersion() int {
if o == nil || IsNil(o.TextIndexVersion) {
var ret int
return ret
}
return *o.TextIndexVersion
}
// GetTextIndexVersionOk returns a tuple with the TextIndexVersion field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IndexOptions) GetTextIndexVersionOk() (*int, bool) {
if o == nil || IsNil(o.TextIndexVersion) {
return nil, false
}
return o.TextIndexVersion, true
}
// HasTextIndexVersion returns a boolean if a field has been set.
func (o *IndexOptions) HasTextIndexVersion() bool {
if o != nil && !IsNil(o.TextIndexVersion) {
return true
}
return false
}
// SetTextIndexVersion gets a reference to the given int and assigns it to the TextIndexVersion field.
func (o *IndexOptions) SetTextIndexVersion(v int) {
o.TextIndexVersion = &v
}
// GetUnique returns the Unique field value if set, zero value otherwise
func (o *IndexOptions) GetUnique() bool {
if o == nil || IsNil(o.Unique) {
var ret bool
return ret
}
return *o.Unique
}
// GetUniqueOk returns a tuple with the Unique field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IndexOptions) GetUniqueOk() (*bool, bool) {
if o == nil || IsNil(o.Unique) {
return nil, false
}
return o.Unique, true
}
// HasUnique returns a boolean if a field has been set.
func (o *IndexOptions) HasUnique() bool {
if o != nil && !IsNil(o.Unique) {
return true
}
return false
}
// SetUnique gets a reference to the given bool and assigns it to the Unique field.
func (o *IndexOptions) SetUnique(v bool) {
o.Unique = &v
}
// GetWeights returns the Weights field value if set, zero value otherwise
func (o *IndexOptions) GetWeights() map[string]interface{} {
if o == nil || IsNil(o.Weights) {
var ret map[string]interface{}
return ret
}
return o.Weights
}
// GetWeightsOk returns a tuple with the Weights field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IndexOptions) GetWeightsOk() (map[string]interface{}, bool) {
if o == nil || IsNil(o.Weights) {
return map[string]interface{}{}, false
}
return o.Weights, true
}
// HasWeights returns a boolean if a field has been set.
func (o *IndexOptions) HasWeights() bool {
if o != nil && !IsNil(o.Weights) {
return true
}
return false
}
// SetWeights gets a reference to the given map[string]interface{} and assigns it to the Weights field.
func (o *IndexOptions) SetWeights(v map[string]interface{}) {
o.Weights = v
}
func (o IndexOptions) MarshalJSONWithoutReadOnly() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o IndexOptions) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Var2dsphereIndexVersion) {
toSerialize["2dsphereIndexVersion"] = o.Var2dsphereIndexVersion
}
if !IsNil(o.Background) {
toSerialize["background"] = o.Background
}
if !IsNil(o.Bits) {
toSerialize["bits"] = o.Bits
}
if !IsNil(o.BucketSize) {
toSerialize["bucketSize"] = o.BucketSize
}
if !IsNil(o.ColumnstoreProjection) {
toSerialize["columnstoreProjection"] = o.ColumnstoreProjection
}
if !IsNil(o.DefaultLanguage) {
toSerialize["default_language"] = o.DefaultLanguage
}
if !IsNil(o.ExpireAfterSeconds) {
toSerialize["expireAfterSeconds"] = o.ExpireAfterSeconds
}
if !IsNil(o.Hidden) {
toSerialize["hidden"] = o.Hidden
}
if !IsNil(o.LanguageOverride) {
toSerialize["language_override"] = o.LanguageOverride
}
if !IsNil(o.Max) {
toSerialize["max"] = o.Max
}
if !IsNil(o.Min) {
toSerialize["min"] = o.Min
}
if !IsNil(o.Name) {
toSerialize["name"] = o.Name
}
if !IsNil(o.PartialFilterExpression) {
toSerialize["partialFilterExpression"] = o.PartialFilterExpression
}
if !IsNil(o.Sparse) {
toSerialize["sparse"] = o.Sparse
}
if !IsNil(o.StorageEngine) {
toSerialize["storageEngine"] = o.StorageEngine
}
if !IsNil(o.TextIndexVersion) {
toSerialize["textIndexVersion"] = o.TextIndexVersion
}
if !IsNil(o.Unique) {
toSerialize["unique"] = o.Unique
}
if !IsNil(o.Weights) {
toSerialize["weights"] = o.Weights
}
return toSerialize, nil
}