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

Ignore $readPreference field #3996

Merged
merged 5 commits into from
Jan 23, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
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
11 changes: 6 additions & 5 deletions internal/handler/common/count.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,12 @@ type CountParams struct {

Fields any `ferretdb:"fields,ignored"` // legacy MongoDB shell adds it, but it is never actually used

Hint any `ferretdb:"hint,ignored"`
ReadConcern *types.Document `ferretdb:"readConcern,ignored"`
Comment string `ferretdb:"comment,ignored"`
LSID any `ferretdb:"lsid,ignored"`
ClusterTime any `ferretdb:"$clusterTime,ignored"`
Hint any `ferretdb:"hint,ignored"`
ReadConcern *types.Document `ferretdb:"readConcern,ignored"`
Comment string `ferretdb:"comment,ignored"`
LSID any `ferretdb:"lsid,ignored"`
ClusterTime any `ferretdb:"$clusterTime,ignored"`
ReadPreference *types.Document `ferretdb:"$readPreference,ignored"`
}

// GetCountParams returns the parameters for the count command.
Expand Down
7 changes: 4 additions & 3 deletions internal/handler/common/delete_params.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,10 @@ type DeleteParams struct {

Let *types.Document `ferretdb:"let,unimplemented"`

WriteConcern *types.Document `ferretdb:"writeConcern,ignored"`
LSID any `ferretdb:"lsid,ignored"`
ClusterTime any `ferretdb:"$clusterTime,ignored"`
WriteConcern *types.Document `ferretdb:"writeConcern,ignored"`
LSID any `ferretdb:"lsid,ignored"`
ClusterTime any `ferretdb:"$clusterTime,ignored"`
ReadPreference *types.Document `ferretdb:"$readPreference,ignored"`
}

// Delete represents single delete operation parameters.
Expand Down
7 changes: 4 additions & 3 deletions internal/handler/common/distinct.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,10 @@ type DistinctParams struct {

Collation *types.Document `ferretdb:"collation,unimplemented"`

ReadConcern *types.Document `ferretdb:"readConcern,ignored"`
LSID any `ferretdb:"lsid,ignored"`
ClusterTime any `ferretdb:"$clusterTime,ignored"`
ReadConcern *types.Document `ferretdb:"readConcern,ignored"`
LSID any `ferretdb:"lsid,ignored"`
ClusterTime any `ferretdb:"$clusterTime,ignored"`
ReadPreference *types.Document `ferretdb:"$readPreference,ignored"`
}

// GetDistinctParams returns `distinct` command parameters.
Expand Down
15 changes: 8 additions & 7 deletions internal/handler/common/find.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,14 @@ type FindParams struct {
Collation *types.Document `ferretdb:"collation,unimplemented"`
Let *types.Document `ferretdb:"let,unimplemented"`

AllowDiskUse bool `ferretdb:"allowDiskUse,ignored"`
ReadConcern *types.Document `ferretdb:"readConcern,ignored"`
Max *types.Document `ferretdb:"max,ignored"`
Min *types.Document `ferretdb:"min,ignored"`
Hint any `ferretdb:"hint,ignored"`
LSID any `ferretdb:"lsid,ignored"`
ClusterTime any `ferretdb:"$clusterTime,ignored"`
AllowDiskUse bool `ferretdb:"allowDiskUse,ignored"`
ReadConcern *types.Document `ferretdb:"readConcern,ignored"`
Max *types.Document `ferretdb:"max,ignored"`
Min *types.Document `ferretdb:"min,ignored"`
Hint any `ferretdb:"hint,ignored"`
LSID any `ferretdb:"lsid,ignored"`
ClusterTime any `ferretdb:"$clusterTime,ignored"`
ReadPreference *types.Document `ferretdb:"$readPreference,ignored"`

ReturnKey bool `ferretdb:"returnKey,unimplemented-non-default"`
OplogReplay bool `ferretdb:"oplogReplay,ignored"`
Expand Down
1 change: 1 addition & 0 deletions internal/handler/common/findandmodify.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ type FindAndModifyParams struct {
BypassDocumentValidation bool `ferretdb:"bypassDocumentValidation,ignored"`
LSID any `ferretdb:"lsid,ignored"`
ClusterTime any `ferretdb:"$clusterTime,ignored"`
ReadPreference *types.Document `ferretdb:"$readPreference,ignored"`
}

// GetFindAndModifyParams returns `findAndModifyParams` command parameters.
Expand Down
1 change: 1 addition & 0 deletions internal/handler/common/update_params.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ type UpdateParams struct {
WriteConcern *types.Document `ferretdb:"writeConcern,ignored"`
LSID any `ferretdb:"lsid,ignored"`
ClusterTime any `ferretdb:"$clusterTime,ignored"`
ReadPreference *types.Document `ferretdb:"$readPreference,ignored"`
}

// Update represents a single update operation parameters.
Expand Down
4 changes: 2 additions & 2 deletions tools/checkcomments/testdata/testdata.go
AlekSi marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@
package testdata

func testCorrect() {
// TODO https://github.com/FerretDB/FerretDB/issues/3413
// TODO https://github.com/FerretDB/FerretDB/issues/3615
}

func testIncorrectNoURL() {
// TODO no URL // want "invalid TODO: incorrect format"
}

func testIncorrectFormat() {
// TODO: https://github.com/FerretDB/FerretDB/issues/3413 // want "invalid TODO: incorrect format"
// TODO: https://github.com/FerretDB/FerretDB/issues/3615 // want "invalid TODO: incorrect format"
}

func testCorrectFormatClosed() {
Expand Down
Loading