indexCreate overloads
plus version bump and syntax fix in the README
This commit is contained in:
parent
fdd95bfe95
commit
43aefbef78
@ -55,7 +55,7 @@ let post = fetchPost "the-post-id" conn |> Async.RunSynchronously
|
||||
|
||||
```fsharp
|
||||
// Function names cannot be polymorphic the way object-oriented methods can, so filter's three overloads become
|
||||
filter r.HashMap("age", 30)
|
||||
filter (r.HashMap ("age", 30))
|
||||
// and
|
||||
filterFunc (fun row -> row.["age"].Eq(30))
|
||||
// and
|
||||
|
@ -65,6 +65,15 @@ let indexCreate indexName conn (table : Ast.Table) =
|
||||
table.IndexCreate indexName
|
||||
|> asyncReqlResult conn
|
||||
|
||||
/// Create an index on the given table using a function
|
||||
let indexCreateFunc indexName (f : Ast.ReqlExpr -> obj) conn (table : Ast.Table) =
|
||||
table.IndexCreate (indexName, Ast.ReqlFunction1 f)
|
||||
|> asyncReqlResult conn
|
||||
|
||||
let indexCreateJS indexName jsString conn (table : Ast.Table) =
|
||||
table.IndexCreate (indexName, Ast.Javascript (jsString :> obj))
|
||||
|> asyncReqlResult conn
|
||||
|
||||
/// Get a document by its primary key
|
||||
let get documentId (table : Ast.Table) =
|
||||
table.Get documentId
|
||||
|
@ -12,7 +12,7 @@
|
||||
<Copyright>See LICENSE</Copyright>
|
||||
<PackageTags>RethinkDB document F#</PackageTags>
|
||||
<VersionPrefix>0.7.0</VersionPrefix>
|
||||
<VersionSuffix>alpha-0001</VersionSuffix>
|
||||
<VersionSuffix>alpha-0002</VersionSuffix>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@ -21,8 +21,9 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="FSharp.Core" Version="4.2.*" />
|
||||
<PackageReference Include="FSharp.Core" Version="4.*" />
|
||||
<PackageReference Include="FSharp.NET.Sdk" Version="1.0.*" PrivateAssets="All" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="10.*" />
|
||||
<PackageReference Include="RethinkDb.Driver" Version="2.*" />
|
||||
</ItemGroup>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user