aaronpowell / FSharp.CosmosDb

An F# wrapper around Cosmos DB's .NET SDK to make it more friendly for F# developers
MIT License
79 stars 12 forks source link

Linq Query Operation #66

Open albert-du opened 2 years ago

albert-du commented 2 years ago

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