ExpCond Method

Conditionally select an expression from a variable number of expression pairs followed by default expression action. Requires server version 5.6.0+.

Definition

Namespace: Aerospike.Client
Assembly: AerospikeClient (in AerospikeClient.dll) Version: 7.0.1
C#
public static Exp Cond(
	params Exp[] exps
)

Parameters

exps  Exp
 

Return Value

Exp

Example

C#
// Args Format: bool exp1, action exp1, bool exp2, action exp2, ..., action-default
// Apply operator based on type.
Exp.cond(
  Exp.EQ(Exp.IntBin("type"), Exp.Val(0)), Exp.Add(Exp.IntBin("val1"), Exp.IntBin("val2")),
  Exp.EQ(Exp.IntBin("type"), Exp.Val(1)), Exp.Sub(Exp.IntBin("val1"), Exp.IntBin("val2")),
  Exp.EQ(Exp.IntBin("type"), Exp.Val(2)), Exp.Mul(Exp.IntBin("val1"), Exp.IntBin("val2")),
  Exp.Val(-1));

See Also