Skip to content

Commit

Permalink
Ignore $readPreference field (#3996)
Browse files Browse the repository at this point in the history
  • Loading branch information
b1ron authored Jan 23, 2024
1 parent 5201cab commit 0e2d108
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 18 deletions.
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

0 comments on commit 0e2d108

Please sign in to comment.