Skip to content
Brian Chavez edited this page Nov 4, 2015 · 80 revisions

RethinkDb.Driver is a ReQL driver for RethinkDB. This driver is closely ported from the official Java driver. Architecturally, both the Java driver and C# driver are very similar. The C# driver has some extra language features that add some expressiveness over the Java driver (such as anonymous type optional arguments). This C# driver is generally considered a super-set of features of the official Java driver.

This driver aims for 100% API compatibility and ReQL completeness with the official drivers.

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.

The C# driver supports additional integrated language features such as anonymous type arguments. The full documentation can be found here.

Poco Support

This C# driver supports POCO serialization to RethinkDB via Newtonsoft.Json. If you have very unique POCO serialization requirements, you can override the default PocoConverter method.

Converter.PocoConverter = (poco) =>
      {
         return JObject.FromObject(poco, /*with custom serialization*/);
      }

Keep in mind, there are some native types that RethinkDB expects in a specific JSON format. Native ReQL types time and dates (DateTime and DateTimeOffset) need to be in a specific format in order to perform ReQL operations on them. By default, native ReQL types are converted automatically if the default PocoConverter is used; however, if you override the default PocoConverter you will need to ensure DateTime and DateTimeOffset and other ReQL native types get converted correctly.

Driver Development

If you're interested in making a contribution or want to build the driver manually, these pages will be helpful.

Clone this wiki locally