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 Jan 31, 2024
1 parent b0ad3e6 commit 2e5ced2
Showing 1 changed file with 4 additions and 0 deletions.
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 2e5ced2

Please sign in to comment.