lib/fauna/query.rb in fauna-2.3.0 vs lib/fauna/query.rb in fauna-2.4.0
- old
+ new
@@ -62,10 +62,18 @@
# Reference: {FaunaDB Basic Forms}[https://fauna.com/documentation/queries#basic_forms]
def object(fields)
Expr.new object: Expr.wrap_values(fields)
end
+ ##
+ # A query expression
+ #
+ # Reference: {FaunaDB Basic Forms}[https://fauna.com/documentation/queries#basic_forms]
+ def query(expr)
+ Expr.new query: Expr.wrap(expr)
+ end
+
# :section: Basic forms
##
# An at expression
#
@@ -172,10 +180,18 @@
# See also #lambda.
def lambda_expr(var, expr)
Expr.new lambda: Expr.wrap(var), expr: Expr.wrap(expr)
end
+ ##
+ # A call expression
+ #
+ # Reference: {FaunaDB Basic Forms}[https://fauna.com/documentation/queries#basic_forms]
+ def call(name, *args)
+ Expr.new call: Expr.wrap(name), arguments: Expr.wrap_varargs(args)
+ end
+
# :section: Collection Functions
##
# A map expression
#
@@ -355,10 +371,18 @@
# Reference: {FaunaDB Write functions}[https://fauna.com/documentation/queries#write_functions]
def create_key(params)
Expr.new create_key: Expr.wrap(params)
end
+ ##
+ # A create function expression
+ #
+ # Reference: {FaunaDB Write functions}[https://fauna.com/documentation/queries#write_functions]
+ def create_function(params)
+ Expr.new create_function: Expr.wrap(params)
+ end
+
# :section: Set Functions
##
# A match expression
#
@@ -514,9 +538,17 @@
# An index function
#
# Reference: {FaunaDB Miscellaneous Functions}[https://fauna.com/documentation#queries-misc_functions]
def index(name)
Expr.new index: Expr.wrap(name)
+ end
+
+ ##
+ # A function function
+ #
+ # Reference: {FaunaDB Miscellaneous Functions}[https://fauna.com/documentation#queries-misc_functions]
+ def function(name)
+ Expr.new function: Expr.wrap(name)
end
##
# An equals function
#