internal AqlUpsert(string collectionName, IAqlValue search, IAqlValue insert, UpdateBuilder <T> update) { _collectionName = collectionName; _search = search; _insert = insert; _update = update; _options = new Dictionary <string, object>(); }
public UpdateBuilder<T> Inc<TV>(Expression<Func<T, TV>> field, IAqlValue<TV> build) { var expression = new FieldExpression<T, TV>(field); _updates.Add(new AqlUpdateInc(expression.Field, (_fieldname ?? expression.Name), build)); return this; }
public UpdateBuilder<T> Set<TV>(Expression<Func<T, TV>> field, IAqlValue<TV> value) { var expression = new FieldExpression<T, TV>(field); _updates.Add(new AqlUpdateSetValue(expression.Field, value)); return this; }
public AQuery Upsert <T>(string collectionName, IAqlValue search, IAqlValue insert, Action <UpdateBuilder <T> > build) { var update = new UpdateBuilder <T>(); build.Invoke(update); _queries.Add(new AqlUpsert <T>(collectionName, search, insert, update)); return(this); }
internal AqlSort(IAqlValue field, Direction direction) { _field = field; _direction = direction; }
/// <summary> /// SHA1(value) /// </summary> /// <param name="v">AqlValue</param> /// <returns>AqlValue</returns> public static AqlFunctionValue <string> SHA1(IAqlValue <string> v) { return(new("SHA1", v)); }
/// <summary> /// SHA512(value) /// </summary> /// <param name="v">AqlValue</param> /// <returns>AqlValue</returns> public static AqlFunctionValue <string> JsonStringify <T>(IAqlValue <T> v) { return(new("JSON_STRINGIFY", v)); }
internal AqlCollect(string alias, IAqlValue value) { _alias = alias; _value = value; }
public AQuery Insert(string collectionName, IAqlValue definition, AqlInsert.Options options = null) { _queries.Add(new AqlInsert(collectionName, definition, options)); return(this); }
public AQuery Let(string alias, IAqlValue value) { _queries.Add(new AqlLet(alias, value)); return(this); }
public AQuery Aggregate(string alias, IAqlValue value) { _queries.Add(new AqlAggregate(alias, value)); return(this); }
/// <summary> /// value1 op value2 /// </summary> /// <param name="v1">Value</param> /// <param name="op">Operand</param> /// <param name="v2">Value</param> /// <typeparam name="T">Type of values</typeparam> /// <returns>AqlValue</returns> public static AqlOperationValue <T> Op <T>(IAqlValue <T> v1, string op, IAqlValue <T> v2) { return(new AqlOperationValue <T>(op, v1, v2)); }
/// <summary> /// DOCUMENT(collectionName, documentKey) /// </summary> /// <param name="c">Collection Name</param> /// <param name="k">AqlValue representing documents key</param> /// <typeparam name="T">Type of document returned</typeparam> /// <returns>AqlValue</returns> public static AqlCollectionFunctionValue <T> Document <T>(string c, IAqlValue <string> k) { return(new AqlCollectionFunctionValue <T>(c, k)); }
/// <summary> /// (condition ? positive : negative) /// </summary> /// <param name="c">Condition</param> /// <param name="p">AqlValue returned when condition is true</param> /// <param name="n">AqlValue returned when condition is false</param> /// <typeparam name="T">Type of field returned</typeparam> /// <returns>AqlValue</returns> public static AqlIf <T> If <T>(IAqlExpression <bool> c, IAqlValue <T> p, IAqlValue <T> n) { return(new AqlIf <T>(c, p, n)); }
internal AqlFilter(string op, IAqlValue value1, IAqlValue value2) { _operator = op; _value1 = value1; _value2 = value2; }
/// <summary> /// COUNT(value) /// </summary> /// <param name="v">AqlFieldValue</param> /// <typeparam name="T">Type of value returned</typeparam> /// <returns>AqlValue</returns> public static AqlFunctionValue <int> Count <T>(IAqlValue <T> v) where T : IEnumerable { return(new AqlFunctionValue <int>("COUNT", v)); }
public AQuery Upsert <T>(string collectionName, IAqlValue search, IAqlValue insert, UpdateBuilder <T> update) { _queries.Add(new AqlUpsert <T>(collectionName, search, insert, update)); return(this); }
/// <summary> /// RANGE(start, end, step) /// </summary> /// <param name="start">AqlValue</param> /// <param name="end">AqlValue</param> /// <param name="step">AqlValue</param> /// <returns>AqlValue</returns> public static AqlFunctionValue <int> Range(IAqlValue <int> start, IAqlValue <int> end, IAqlValue <int> step) { return(new AqlFunctionValue <int>("RANGE", start, end, step)); }
public AQuery Sort(IAqlValue field, AqlSort.Direction direction) { _queries.Add(new AqlSort(field, direction)); return(this); }
internal AqlInsert(string collectionName, IAqlValue value, Options options = null) { _collectionName = collectionName; _value = value; _options = options; }
public AQuery For(string alias, IAqlValue collection) { _queries.Add(new AqlFor(alias, collection)); return(this); }
public static AqlFilterAnd Between <T>(IAqlValue <T> value, IAqlValue <T> min, IAqlValue <T> max) { return(And(Gte(value, min), Lte(value, max))); }
public AqlUpdateInc(string field, string fieldname, IAqlValue value) { _field = field; _fieldname = fieldname; _value = value; }
public static AqlFilter Nin <T>(IAqlValue <T> value1, AqlArrayValue <T> value2) { return(new AqlFilter("NOT IN", value1, value2)); }
public AqlUpdateSetValue(string field, IAqlValue value) { _field = field; _value = value; }
public static AqlFilter Nin <T>(IAqlValue <T> value1, IAqlValue <IEnumerable <T> > value2) { return(new AqlFilter("NOT IN", value1, value2)); }
/// <summary> /// SHA512(value) /// </summary> /// <param name="v">AqlValue</param> /// <returns>AqlValue</returns> public static AqlFunctionValue <T> JsonParse <T>(IAqlValue <string> v) { return(new("JSON_PARSE", v)); }
public static AqlFilter Eq <T>(IAqlValue <T> value1, IAqlValue <T> value2) { return(new AqlFilter("==", value1, value2)); }
internal AqlAggregate(string alias, IAqlValue value) { _alias = alias; _value = value; }
internal AqlCollectionFunctionValue(string collection, IAqlValue value) { _collection = collection; _value = value; }