Skip to content

Commit

Permalink
cli/object: Support numeric queries in search command
Browse files Browse the repository at this point in the history
Recently, NeoFS object search protocol was extended with `<`, `<=`, `>`
and `>=` numeric operators. These operators provide client comparison
operations of decimal integers.

From now users can use `GT`, `GE`, `LT` and `LE` binary operators to
form their numeric object queries for payload size, creation epoch or
any other user-defined object attribute.

Refs #2730.

Signed-off-by: Leonard Lyubich <[email protected]>
  • Loading branch information
cthulhu-rider committed Feb 26, 2024
1 parent 56011c8 commit c786251
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ neofs-cli-linux-amd64 now.
- `neofs-adm morph generate-storage-wallet` now supports more than one wallet generation per call (#2425)
- Missing containers cleanup (#1663)
- Support of numeric object search queries (#2733)
- Support of `GT`, `GE`, `LT` and `LE` numeric comparison operators in CLI (#2733)

### Fixed
- IR does not wait for HTTP servers to stop gracefully before exiting (#2704)
Expand Down
4 changes: 4 additions & 0 deletions cmd/neofs-cli/modules/object/search.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ var searchBinaryOpVocabulary = map[string]object.SearchMatchType{
"EQ": object.MatchStringEqual,
"NE": object.MatchStringNotEqual,
"COMMON_PREFIX": object.MatchCommonPrefix,
"GT": object.MatchNumGT,
"GE": object.MatchNumGE,
"LE": object.MatchNumLE,
"LT": object.MatchNumLT,
}

func parseSearchFilters(cmd *cobra.Command) (object.SearchFilters, error) {
Expand Down

0 comments on commit c786251

Please sign in to comment.