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 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
Next Next commit
ignore $readPreference
  • Loading branch information
b1ron committed Jan 22, 2024
commit ea5d04ae617257efef212b91ebc2334463a10ddc
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
Loading