Skip to content

Commit

Permalink
FMWK-355 Update repository query documentation (#725)
Browse files Browse the repository at this point in the history
  • Loading branch information
agrgr authored Mar 27, 2024
1 parent f26fc3a commit 0b07610
Show file tree
Hide file tree
Showing 80 changed files with 215 additions and 124 deletions.
24 changes: 18 additions & 6 deletions src/main/asciidoc/reference/query-methods-collection.adoc
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[[aerospike.query_methods.collection]]
= Collection Repository Queries

[width="100%",cols="<7%,<30%,<25%",options="header",]
[width="100%",cols="<7%,<30%,<25%,<20%",options="header",]
|===
|Keyword |Repository query sample |Snippet
|Keyword |Repository query sample |Snippet |Notes

|Is, Equals

Expand All @@ -13,35 +13,39 @@ or no keyword a|
findByStringList(Collection<String> stringList)
----
|...where x.stringList = ?
|

|Not, IsNot a|
[source,java]
----
findByStringListNot(Collection<String> stringList)
----
|...where x.stringList <> ?
|

|In a|
[source,java]
----
findByStringListIn(Collection<Collection<String>>)
----
|...where x.stringList in ?
|Find records where `stringList` bin value equals one of the collections in the given argument.

|Not In a|
[source,java]
----
findByStringListNotIn(Collection<Collection<String>>)
----
|...where x.stringList not in ?
|Find records where `stringList` bin value is not equal to any of the collections in the given argument.

|Null, IsNull a|
[source,java]
----
findByStringListIsNull()
----

|...where x.stringList = null or x.stringList does not exist
|The same as "does not exist", objects and fields exist in AerospikeDB when their value is not equal to null.

|Exists

Expand All @@ -57,69 +61,77 @@ findByStringListNotNull()
----

|...where x.stringList != null

("Exists" and "IsNotNull" represent the same functionality and can be used interchangeably, objects and fields exist when their value is not equal to null)
|("Exists" and "IsNotNull" represent the same functionality and can be used interchangeably, objects and fields exist in AerospikeDB when their value is not equal to null).

|LessThan, IsLessThan a|
[source,java]
----
findByStringListLessThan(Collection<String> stringList)
----
|...where x.stringList < ?
|Find records where `stringList` bin value has fewer elements or has a corresponding element lower in ordering than in the given argument. See https://docs.aerospike.com/server/guide/data-types/cdt-ordering#list[information about ordering].

|LessThanEqual, IsLessThanEqual a|
[source,java]
----
findByStringListLessThanEqual(Collection<String> stringList)
----
|...where x.stringList <= ?
|...where x.stringList < = ?
|Find records where `stringList` bin value has smaller or the same amount of elements or has each corresponding element lower in ordering or the same as in the given argument. See https://docs.aerospike.com/server/guide/data-types/cdt-ordering#list[information about ordering].

|GreaterThan, IsGreaterThan a|
[source,java]
----
findByStringListGreaterThan(Collection<String> stringList)
----
|...where x.stringList > ?
|Find records where `stringList` bin value has more elements or has a corresponding element higher in ordering than in the given argument. See https://docs.aerospike.com/server/guide/data-types/cdt-ordering#list[information about ordering].

|GreaterThanEqual, IsGreaterThanEqual a|
[source,java]
----
findByStringListGreaterThanEqual(Collection<String> stringList)
----
|...where x.stringList >= ?
|Find records where `stringList` bin value has larger or the same amount of elements or has each corresponding element higher in ordering or the same as in the given argument. See https://docs.aerospike.com/server/guide/data-types/cdt-ordering#list[information about ordering].

|Between, IsBetween a|
[source,java]
----
findByStringListBetween(Collection<String> lowerLimit, Collection<String> upperLimit)
----
|...where x.stringList between ? and ?
|Find records where `stringList` bin value is in the range between the given arguments. See https://docs.aerospike.com/server/guide/data-types/cdt-ordering#list[information about ordering].

|Containing, IsContaining, Contains a|
[source,java]
----
findByStringListContaining(String string)
----
|...where x.stringList contains ?
|

|NotContaining, IsNotContaining, NotContains a|
[source,java]
----
findByStringListNotContaining(String string)
----
|...where x.stringList not contains ?
|

|And a|
[source,java]
----
findByStringListAndIntList(Collection<String> stringList, Collection<Integer> intList)
----
|...where x.stringList = ? and x.intList = ?
|

|Or a|
[source,java]
----
findByStringListOrIntList(Collection<String> stringList, Collection<Integer> intList)
----
|...where x.stringList = ? or x.intList = ?
|
|===
6 changes: 4 additions & 2 deletions src/main/asciidoc/reference/query-methods-id.adoc
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
[[aerospike.query_methods.id]]
= Id Repository Queries

[width="100%",cols="<7%,<30%,<25%",options="header",]
[width="100%",cols="<7%,<30%,<25%,<20%",options="header",]
|===
|Keyword |Repository query sample |Snippet
|Keyword |Repository query sample |Snippet |Notes

|no keyword a|
[source,java]
----
findById(String id)
----
|...where x.PK = ?
|

|And a|
[source,java]
----
findByIdAndFirstName(String id, String firstName)
----
|...where x.PK = ? and x.firstName = ?
|
|===
40 changes: 34 additions & 6 deletions src/main/asciidoc/reference/query-methods-map.adoc
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[[aerospike.query_methods.map]]
= Map Repository Queries

[width="100%",cols="<7%,<30%,<25%",options="header",]
[width="100%",cols="<7%,<30%,<25%,<20%",options="header",]
|===
|Keyword |Repository query sample |Snippet
|Keyword |Repository query sample |Snippet |Notes

|Is, Equals

Expand All @@ -13,35 +13,39 @@ or no keyword a|
findByStringMap(Map<String, String> stringMap)
----
|...where x.stringMap = ?
|

|Not, IsNot a|
[source,java]
----
findByStringMapNot(Map<String, String> stringMap)
----
|...where x.stringMap <> ?
|

|In a|
[source,java]
----
findByStringMapIn(Collection<Map<String, String>>)
----
|...where x.stringMap in ?
|Find records where `stringMap` bin value equals one of the maps in the given argument.

|Not In a|
[source,java]
----
findByStringMapNotIn(Collection<Map<String, String>>)
----
|...where x.stringMap not in ?
|Find records where `stringMap` bin value is not equal to any of the maps in the given argument.

|Null, IsNull a|
[source,java]
----
findByStringMapIsNull()
----

|...where x.stringMap = null or x.stringMap does not exist
|The same as "does not exist", objects and fields exist in AerospikeDB when their value is not equal to null.

|Exists

Expand All @@ -57,69 +61,93 @@ findByStringMapNotNull()
----

|...where x.stringMap != null

("Exists" and "IsNotNull" represent the same functionality and can be used interchangeably, objects and fields exist when their value is not equal to null)
|"Exists" and "IsNotNull" represent the same functionality and can be used interchangeably, objects and fields exist when their value is not equal to null.

|LessThan, IsLessThan a|
[source,java]
----
findByStringMapLessThan(Map<String, String> stringMap)
----
|...where x.stringMap < ?
|Find records where `stringMap` bin value has fewer elements or has a corresponding element lower in ordering than in the given argument. See https://docs.aerospike.com/server/guide/data-types/cdt-ordering#map[information about ordering].

|LessThanEqual, IsLessThanEqual a|
[source,java]
----
findByStringMapLessThanEqual(Map<String, String> stringMap)
----
|...where x.stringMap <= ?
|...where x.stringMap < = ?
|Find records where `stringMap` bin value has smaller or the same amount of elements or has each corresponding element lower in ordering or the same as in the given argument. See https://docs.aerospike.com/server/guide/data-types/cdt-ordering#map[information about ordering].

|GreaterThan, IsGreaterThan a|
[source,java]
----
findByStringMapGreaterThan(Map<String, String> stringMap)
----
|...where x.stringMap > ?
|Find records where `stringMap` bin value has more elements or has a corresponding element higher in ordering than in the given argument. See https://docs.aerospike.com/server/guide/data-types/cdt-ordering#map[information about ordering].

|GreaterThanEqual, IsGreaterThanEqual a|
[source,java]
----
findByStringMapGreaterThanEqual(Map<String, String> stringMap)
----
|...where x.stringMap >= ?
|Find records where `stringMap` bin value has larger or the same amount of elements or has each corresponding element higher in ordering or the same as in the given argument. See https://docs.aerospike.com/server/guide/data-types/cdt-ordering#map[information about ordering].

|Between, IsBetween a|
[source,java]
----
findByStringMapBetween(Map<String, String> lowerLimit, Map<String, String> upperLimit)
----
|...where x.stringMap between ? and ?
|Find records where `stringMap` bin value is in the range between the given arguments. See https://docs.aerospike.com/server/guide/data-types/cdt-ordering#map[information about ordering].

|Containing, IsContaining, Contains a|
[source,java]
----
findByStringMapContaining(AerospikeQueryCriterion criterion, String string)
findByStringMapContaining(AerospikeQueryCriterion criterionPair, String string, String value)
----
|...where x.stringMap contains ?
a|* Find records where `stringMap` bin value (which is a Map) contains key "key1":

`findByStringMapContaining(KEY, "key1")`

* Find records where `stringMap` bin value (which is a Map) contains value "value1":

`findByStringMapContaining(VALUE, "value1")`

* Find records where `stringMap` bin value (which is a Map) contains key "key1" with the value "value1":

`findByStringMapContaining(KEY_VALUE_PAIR, "key1", "value1")`

|NotContaining, IsNotContaining, NotContains a|
[source,java]
----
findByStringNameNotContaining(AerospikeQueryCriterion criterion, String string)
----
|...where x.stringMap not contains ?
|`findByStringMapNotContaining(KEY, "key1")`

`findByStringMapNotContaining(VALUE, "value1")`

`findByStringMapNotContaining(KEY_VALUE_PAIR, "key1", "value1")`

|And a|
[source,java]
----
findByStringMapAndIntMap(Map<String, String> stringMap, Map<Integer, Integer> intMap)
----
|...where x.stringMap = ? and x.intMap = ?
|

|Or a|
[source,java]
----
findByStringMapOrIntMap(Map<String, String> stringMap, Map<Integer, Integer> intList)
----
|...where x.stringMap = ? or x.intMap = ?
|
|===
Loading

0 comments on commit 0b07610

Please sign in to comment.