ExpCond Method

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

Namespace:  Aerospike.Client
Assembly:  AerospikeClient (in AerospikeClient.dll) Version: 5.1.1.0 (5.1.1)
Syntax

C#
public static Exp Cond(
	params Exp[] exps
)

Parameters

exps
Type: Aerospike.ClientExp

Return Value

Type: Exp
Examples

// 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

Reference