From d31f07633d228024ca9e41fef722992dc9f33aca Mon Sep 17 00:00:00 2001 From: Keenan Nemetz Date: Fri, 19 Apr 2024 17:50:15 -0700 Subject: [PATCH] change collection update and collection delete cli param checks --- cli/collection_delete.go | 2 +- cli/collection_update.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cli/collection_delete.go b/cli/collection_delete.go index 1d55b4c7e5..a9776d1985 100644 --- a/cli/collection_delete.go +++ b/cli/collection_delete.go @@ -40,7 +40,7 @@ Example: delete by filter: } switch { - case len(argDocID) > 0: + case argDocID != "": docID, err := client.NewDocIDFromString(argDocID) if err != nil { return err diff --git a/cli/collection_update.go b/cli/collection_update.go index 35ea7aefac..3e676edce9 100644 --- a/cli/collection_update.go +++ b/cli/collection_update.go @@ -48,13 +48,13 @@ Example: update private docID, with identity: } switch { - case len(filter) > 0 && len(updater) > 0: + case filter != "" && updater != "": res, err := col.UpdateWithFilter(cmd.Context(), filter, updater) if err != nil { return err } return writeJSON(cmd, res) - case len(argDocID) > 0 && len(args) == 1: + case argDocID != "" && len(args) == 1: docID, err := client.NewDocIDFromString(argDocID) if err != nil { return err