Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GODRIVER-1736 Fix deprecation notice formats #503

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions mongo/cursor.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,8 @@ func (c *Cursor) closeImplicitSession() {
// BatchCursorFromCursor returns a driver.BatchCursor for the given Cursor. If there is no underlying
// driver.BatchCursor, nil is returned.
//
// Deprecated: This is an unstable function because the driver.BatchCursor type exists in the "x" package. Both this
// function and the driver.BatchCursor type should not be used by applications and may be changed or removed in any
// Deprecated: This is an unstable function because the driver.BatchCursor type exists in the "x" package. Neither this
// function nor the driver.BatchCursor type should not be used by applications and may be changed or removed in any
iwysiu marked this conversation as resolved.
Show resolved Hide resolved
// release.
func BatchCursorFromCursor(c *Cursor) *driver.BatchCursor {
bc, _ := c.bc.(*driver.BatchCursor)
Expand Down
32 changes: 16 additions & 16 deletions mongo/index_options_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,127 +40,127 @@ func (iob *IndexOptionsBuilder) ExpireAfterSeconds(expireAfterSeconds int32) *In
return iob
}

// Name spcifies a value for the name option.
// Name specifies a value for the name option.
//
// Deprecated: Use the IndexOptions.SetName function in mongo/options instead.
func (iob *IndexOptionsBuilder) Name(name string) *IndexOptionsBuilder {
iob.document = append(iob.document, bson.E{"name", name})
return iob
}

// Sparse spcifies a value for the sparse option.
// Sparse specifies a value for the sparse option.
//
// Deprecated: Use the IndexOptions.SetSparse function in mongo/options instead.
func (iob *IndexOptionsBuilder) Sparse(sparse bool) *IndexOptionsBuilder {
iob.document = append(iob.document, bson.E{"sparse", sparse})
return iob
}

// StorageEngine spcifies a value for the storageEngine option.
// StorageEngine specifies a value for the storageEngine option.
//
// Deprecated: Use the IndexOptions.SetStorageEngine function in mongo/options instead.
func (iob *IndexOptionsBuilder) StorageEngine(storageEngine interface{}) *IndexOptionsBuilder {
iob.document = append(iob.document, bson.E{"storageEngine", storageEngine})
return iob
}

// Unique spcifies a value for the unique option.
// Unique specifies a value for the unique option.
//
// Deprecated: Use the IndexOptions.SetUnique function in mongo/options instead.
func (iob *IndexOptionsBuilder) Unique(unique bool) *IndexOptionsBuilder {
iob.document = append(iob.document, bson.E{"unique", unique})
return iob
}

// Version spcifies a value for the version option.
// Version specifies a value for the version option.
//
// Deprecated: Use the IndexOptions.SetVersion function in mongo/options instead.
func (iob *IndexOptionsBuilder) Version(version int32) *IndexOptionsBuilder {
iob.document = append(iob.document, bson.E{"v", version})
return iob
}

// DefaultLanguage spcifies a value for the default_language option.
// DefaultLanguage specifies a value for the default_language option.
//
// Deprecated: Use the IndexOptions.SetDefaultLanguage function in mongo/options instead.
func (iob *IndexOptionsBuilder) DefaultLanguage(defaultLanguage string) *IndexOptionsBuilder {
iob.document = append(iob.document, bson.E{"default_language", defaultLanguage})
return iob
}

// LanguageOverride spcifies a value for the language_override option.
// LanguageOverride specifies a value for the language_override option.
//
// Deprecated: Use the IndexOptions.SetLanguageOverride function in mongo/options instead.
func (iob *IndexOptionsBuilder) LanguageOverride(languageOverride string) *IndexOptionsBuilder {
iob.document = append(iob.document, bson.E{"language_override", languageOverride})
return iob
}

// TextVersion spcifies a value for the textIndexVersion option.
// TextVersion specifies a value for the textIndexVersion option.
//
// Deprecated: Use the IndexOptions.SetTextVersion function in mongo/options instead.
func (iob *IndexOptionsBuilder) TextVersion(textVersion int32) *IndexOptionsBuilder {
iob.document = append(iob.document, bson.E{"textIndexVersion", textVersion})
return iob
}

// Weights spcifies a value for the weights option.
// Weights specifies a value for the weights option.
//
// Deprecated: Use the IndexOptions.SetWeights function in mongo/options instead.
func (iob *IndexOptionsBuilder) Weights(weights interface{}) *IndexOptionsBuilder {
iob.document = append(iob.document, bson.E{"weights", weights})
return iob
}

// SphereVersion spcifies a value for the 2dsphereIndexVersion option.
// SphereVersion specifies a value for the 2dsphereIndexVersion option.
//
// Deprecated: Use the IndexOptions.SetSphereVersion function in mongo/options instead.
func (iob *IndexOptionsBuilder) SphereVersion(sphereVersion int32) *IndexOptionsBuilder {
iob.document = append(iob.document, bson.E{"2dsphereIndexVersion", sphereVersion})
return iob
}

// Bits spcifies a value for the bits option.
// Bits specifies a value for the bits option.
//
// Deprecated: Use the IndexOptions.SetBits function in mongo/options instead.
func (iob *IndexOptionsBuilder) Bits(bits int32) *IndexOptionsBuilder {
iob.document = append(iob.document, bson.E{"bits", bits})
return iob
}

// Max spcifies a value for the max option.
// Max specifies a value for the max option.
//
// Deprecated: Use the IndexOptions.SetMax function in mongo/options instead.
func (iob *IndexOptionsBuilder) Max(max float64) *IndexOptionsBuilder {
iob.document = append(iob.document, bson.E{"max", max})
return iob
}

// Min spcifies a value for the min option.
// Min specifies a value for the min option.
//
// Deprecated: Use the IndexOptions.SetMin function in mongo/options instead.
func (iob *IndexOptionsBuilder) Min(min float64) *IndexOptionsBuilder {
iob.document = append(iob.document, bson.E{"min", min})
return iob
}

// BucketSize spcifies a value for the bucketSize option.
// BucketSize specifies a value for the bucketSize option.
//
// Deprecated: Use the IndexOptions.SetBucketSize function in mongo/options instead.
func (iob *IndexOptionsBuilder) BucketSize(bucketSize int32) *IndexOptionsBuilder {
iob.document = append(iob.document, bson.E{"bucketSize", bucketSize})
return iob
}

// PartialFilterExpression spcifies a value for the partialFilterExpression option.
// PartialFilterExpression specifies a value for the partialFilterExpression option.
//
// Deprecated: Use the IndexOptions.SetPartialFilterExpression function in mongo/options instead.
func (iob *IndexOptionsBuilder) PartialFilterExpression(partialFilterExpression interface{}) *IndexOptionsBuilder {
iob.document = append(iob.document, bson.E{"partialFilterExpression", partialFilterExpression})
return iob
}

// Collation spcifies a value for the collation option.
// Collation specifies a value for the collation option.
//
// Deprecated: Use the IndexOptions.SetCollation function in mongo/options instead.
func (iob *IndexOptionsBuilder) Collation(collation interface{}) *IndexOptionsBuilder {
Expand Down
2 changes: 1 addition & 1 deletion mongo/options/findoptions.go
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ type FindOneOptions struct {
// If true, the cursor will not return a document more than once because of an intervening write operation. The
// default value is false.
divjotarora marked this conversation as resolved.
Show resolved Hide resolved
//
// Deprecated: This option has been deprecated in MongoDB version 4.0. The default value is false.
// Deprecated: This option has been deprecated in MongoDB version 4.0.
Snapshot *bool

// A document specifying the sort order to apply to the query. The first document in the sorted order will be
Expand Down