FSharp.CosmosDb icon indicating copy to clipboard operation
FSharp.CosmosDb copied to clipboard

Linq Query Operation

Open albert-du opened this issue 2 years ago • 0 comments

#65

Adds an operation for linq support using an extended version of the FSharp.Linq.QueryBuilder query computational expression called cosmosQuery.

CosmosQueryBuilder extends the standard query syntax by mapping F# functions to BCL equivalents (eg: abs -> System.Math.Abs) to allow for utilization in cosmos queries. https://docs.microsoft.com/en-us/azure/cosmos-db/sql/sql-query-linq-to-sql

Adds the operation to the sample program:

|> Cosmos.linq<Family, string> (fun families ->
    cosmosQuery {
        for family in families do
        where (family.LastName = "Powell")
        select family.LastName
    })
|> Cosmos.execAsync

Currently only "abs" and "acos" mappings are implemented

albert-du avatar Jul 15 '22 21:07 albert-du