Skip to content
Brian Chavez edited this page Oct 29, 2015 · 80 revisions

RethinkDb.Driver is a ReQL driver for RethinkDB. This driver is closely ported from the official Java driver.

This C# driver strives for 100% API compatibility and ReQL completeness.

Getting Started

NuGet Package RethinkDb.Driver

Install-Package RethinkDb.Driver -Pre

If you're using CoreCLR, you may need to manually restore Microsoft.Extensions.Logging references from:

dnu restore --fallbacksource https://www.myget.org/F/aspnetvnext/api/v2/

Documentation

You should be able to follow any examples found in the official ReQL documentation for the Java driver. However, the official Java driver documentation is unavailable at the time of this writing.

In the meantime, the ReQL JavaScript API documentation can suffice. However, there are some known deviations between the official Java API and JavaScript APIs. For example, specifying optional arguments:

Example Query with Optional Arguments
r.table('marvel').getAll('man_of_steel', {index:'code_name'}).run(conn, callback)

The Java driver (and C# driver supports) the use of .optArg() method calls to specify optional arguments. The equivalent query in Java (and C#) is shown below:

Cursor<Foo> foo = r.db(DbName).table("marvel")
                   .getAll("man_of_steel")
                       .optArg("index", "code_name")
                   .run<Foo>(conn);

The C# driver also supports anonymous typed optional arguments. ReQL expressions in other drivers usually specify optional arguments last. The following syntax follows this convention via indexers. The equivalent query above can also be written as:

Cursor<Foo> foo = r.db(DbName).table("marvel")
                   .getAll("man_of_steel")[new {index="code_name"}]
                   .run<Foo>(conn);

Driver Development

Clone this wiki locally