Class UpdateForClause
java.lang.Object
com.couchbase.client.java.query.dsl.clause.UpdateForClause
public class UpdateForClause extends Object
UpdateForClause is a clause used in N1QL Updates, more specifically in the "set" part. For example:
UPDATE bucket1 USE KEYS "abc123" SET "version.description" = "blabla" FOR variable IN path WHEN condition END;
.
This Clause allows you to produce an Expression
that corresponds to "FOR variable IN path WHEN condition END
".- Since:
- 2.2
- Author:
- Simon Baslé
-
Method Summary
Modifier and Type Method Description Expression
end()
Terminates the clause without a particular WHEN condition ("END
") and returns the correspondingExpression
.static UpdateForClause
forIn(String variable, String path)
Creates an updateFor clause that starts withFOR variable IN path
.static UpdateForClause
forWithin(String variable, String path)
Creates an updateFor clause that starts withFOR variable WITHIN path
.UpdateForClause
in(String variable, String path)
Adds a "variable IN path
" section to the clause.Expression
when(Expression condition)
Terminates the clause by adding a condition to it ("WHEN condition END
") and returns the correspondingExpression
.UpdateForClause
within(String variable, String path)
Adds a "variable WITHIN path
" section to the clause.
-
Method Details
-
forIn
Creates an updateFor clause that starts withFOR variable IN path
.- Parameters:
variable
- the first variable in the clause.path
- the first path in the clause, an IN path.- Returns:
- the clause, for chaining. See
when(Expression)
andend()
to complete the clause.
-
forWithin
Creates an updateFor clause that starts withFOR variable WITHIN path
.- Parameters:
variable
- the first variable in the clause.path
- the first path in the clause, a WITHIN path.- Returns:
- the clause, for chaining. See
when(Expression)
andend()
to complete the clause.
-
in
Adds a "variable IN path
" section to the clause.- Parameters:
variable
- the next variable to add to the clause.path
- the path for the variable, an IN path.- Returns:
- the clause, for chaining. See
when(Expression)
andend()
to complete the clause.
-
within
Adds a "variable WITHIN path
" section to the clause.- Parameters:
variable
- the next variable to add to the clause.path
- the path for the variable, a WITHIN path.- Returns:
- the clause, for chaining. See
when(Expression)
andend()
to complete the clause.
-
when
Terminates the clause by adding a condition to it ("WHEN condition END
") and returns the correspondingExpression
.- Parameters:
condition
- the condition to add to the clause, in a WHEN section.- Returns:
- the
Expression
representing the updateFor clause. - See Also:
if you don't need a condition.
-
end
Terminates the clause without a particular WHEN condition ("END
") and returns the correspondingExpression
.- Returns:
- the
Expression
representing the updateFor clause. - See Also:
if you need a condition.
-