@@ -23,7 +23,7 @@ java-cosmos is a client for Azure CosmosDB 's SQL API (also called documentdb fo
2323<dependency >
2424 <groupId >com.github.thunderz99</groupId >
2525 <artifactId >java-cosmos</artifactId >
26- <version >0.6.6 </version >
26+ <version >0.6.7 </version >
2727</dependency >
2828```
2929
@@ -243,36 +243,37 @@ The main difference between Partial update and Patch is that:
243243### Complex queries
244244
245245``` java
246- var cond = Condition . filter(
247- " id" , " id010" , // id equal to 'id010'
248- " lastName" , " Banks" , // last name equal to Banks
249- " firstName !=" , " Andy" , // not equal
250- " firstName LIKE" , " %dy%" , // see cosmosdb LIKE
251- " location" , List . of(" New York" , " Paris" ), // location is 'New York' or 'Paris'. see cosmosdb IN
252- " skills =" , List . of(" Java" , " React" ), // skills equals array ["Java", "React"] exactly
253- " age >=" , 20 , // see cosmosdb compare operators
254- " middleName OR firstName STARTSWITH" , " H" , // see cosmosdb STARTSWITH
255- " desciption CONTAINS" , " Project manager" ,// see cosmosdb CONTAINS
256- " certificates IS_DEFINED" , true , // see cosmosdb IS_DEFINED
257- " families.villa IS_DEFINED" , false , // see cosmosdb IS_DEFINED
258- " age IS_NUMBER" , true , // see cosmosdb type check functions
259- " tagIds ARRAY_CONTAINS" , " T001" , // see cosmosdb ARRAY_CONTAINS
260- " tagIds ARRAY_CONTAINS_ANY" , List . of(" T001" , " T002" ), // see cosmosdb EXISTS
261- " tags ARRAY_CONTAINS_ALL name" , List . of(" Java" , " React" ), // see cosmosdb EXISTS
262- " $OR" , List . of( // add an OR sub condition
263- Condition . filter(" position" , " leader" ), // subquery's fields/order/offset/limit will be ignored
264- Condition . filter(" organization.id" , " executive_committee" )
265- ),
266- " $OR 2" , List . of( // add another OR sub condition (name it $OR xxx in order to avoid the same key to a previous $OR )
267- Condition . filter(" position" , " leader" ), // subquery's fields/order/offset/limit will be ignored
268- Condition . filter(" organization.id" , " executive_committee" )
269- ),
270- " $AND" , List . of(
271- Condition . filter(" tagIds ARRAY_CONTAINS_ALL" , List . of(" T001" , " T002" )). not() // A negative condition. see cosmosdb NOT
272- Condition . filter(" city" , " Tokyo" )
273- ),
274- " $NOT" , Map . of(" lastName CONTAINS" , " Willington" ), // A negative query using $NOT
275- " $NOT 2" , Map . of(" $OR 3" , // A nested filter using $NOT and $OR
246+ var cond= Condition . filter(
247+ " id" ," id010" , // id equal to 'id010'
248+ " lastName" ," Banks" , // last name equal to Banks
249+ " firstName !=" ," Andy" , // not equal
250+ " firstName LIKE" ," %dy%" , // see cosmosdb LIKE
251+ " location" ,List . of(" New York" ," Paris" ), // location is 'New York' or 'Paris'. see cosmosdb IN
252+ " skills =" ,List . of(" Java" ," React" ), // skills equals array ["Java", "React"] exactly
253+ " age >=" ,20 , // see cosmosdb compare operators
254+ " firstName STARTSWITH" ," H" , // see cosmosdb STARTSWITH
255+ " desciption CONTAINS" ," Project manager" ,// see cosmosdb CONTAINS
256+ " fullName.last RegexMatch" ," [A-Z]{1}ank\\ w+$" , // see cosmosdb RegexMatch
257+ " certificates IS_DEFINED" ,true , // see cosmosdb IS_DEFINED
258+ " families.villa IS_DEFINED" ,false , // see cosmosdb IS_DEFINED
259+ " age IS_NUMBER" ,true , // see cosmosdb type check functions
260+ " tagIds ARRAY_CONTAINS" ," T001" , // see cosmosdb ARRAY_CONTAINS
261+ " tagIds ARRAY_CONTAINS_ANY" ,List . of(" T001" ," T002" ), // see cosmosdb EXISTS
262+ " tags ARRAY_CONTAINS_ALL name" ,List . of(" Java" ," React" ), // see cosmosdb EXISTS
263+ " $OR" ,List . of( // add an OR sub condition
264+ Condition . filter(" position" ," leader" ), // subquery's fields/order/offset/limit will be ignored
265+ Condition . filter(" organization.id" ," executive_committee" )
266+ ),
267+ " $OR 2" ,List . of( // add another OR sub condition (name it $OR xxx in order to avoid the same key to a previous $OR )
268+ Condition . filter(" position" ," leader" ), // subquery's fields/order/offset/limit will be ignored
269+ Condition . filter(" organization.id" ," executive_committee" )
270+ ),
271+ " $AND" ,List . of(
272+ Condition . filter(" tagIds ARRAY_CONTAINS_ALL" ,List . of(" T001" ," T002" )). not() // A negative condition. see cosmosdb NOT
273+ Condition . filter(" city" ," Tokyo" )
274+ ),
275+ " $NOT" ,Map . of(" lastName CONTAINS" ," Willington" ), // A negative query using $NOT
276+ " $NOT 2" ,Map . of(" $OR 3" , // A nested filter using $NOT and $OR
276277 List . of(
277278 Map . of(" lastName" , " " ), // note they will do the same thing using Condition.filter or Map.of
278279 Map . of(" age >=" , 20 )
0 commit comments