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 28, 2024
1 parent 30e355c commit 68d0a41
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 @@ -5,6 +5,7 @@ Changelog for NeoFS Node

### Added
- Support of numeric object search queries (#2733)
- Support of `GT`, `GE`, `LT` and `LE` numeric comparison operators in CLI (#2733)

### Fixed
- Access to `PUT` objects no longer grants `DELETE` rights (#2261)
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 68d0a41

Please sign in to comment.