Class: RethinkDBAdapter

RethinkDBAdapter


new RethinkDBAdapter(opts)

RethinkDBAdapter class.

Parameters:
Name Type Argument Description
opts Object <optional>

Configuration opts.

Properties
Name Type Argument Default Description
host string <optional>
'localhost'

TODO

port number <optional>
28015

TODO

authKey string <optional>
''

TODO

db string <optional>
'test'

TODO

min number <optional>
10

TODO

max number <optional>
50

TODO

bufferSize number <optional>
10

TODO

Source:
Example
import {DS} from 'js-data'
import RethinkDBAdapter from 'js-data-rethinkdb'
const store = new DS()
const adapter = new RethinkDBAdapter()
store.registerAdapter('rethinkdb', adapter, { 'default': true })

Methods


create(Resource, props, opts)

Create a new record.

Parameters:
Name Type Argument Description
Resource Object

The Resource.

props Object

The record to be created.

opts Object <optional>

Configuration options.

Source:
Returns:
Type
Promise

destroy(Resource, id, opts)

Destroy the record with the given primary key.

Parameters:
Name Type Argument Description
Resource Object

The Resource.

id string | number

Primary key of the record to destroy.

opts Object <optional>

Configuration options.

Source:
Returns:
Type
Promise

destroyAll(Resource, query, opts)

Destroy the records that match the selection query.

Parameters:
Name Type Argument Description
Resource Object

the Resource.

query Object <optional>

Selection query.

opts Object <optional>

Configuration options.

Source:
Returns:
Type
Promise

find(Resource, id, opts)

Retrieve the record with the given primary key.

Parameters:
Name Type Argument Description
Resource Object

The Resource.

id string | number

Primary key of the record to retrieve.

opts Object <optional>

Configuration options.

Properties
Name Type Argument Default Description
with Array.<string> <optional>
[]

TODO

Source:
Returns:
Type
Promise

findAll(Resource, query, opts)

Retrieve the records that match the selection query.

Parameters:
Name Type Argument Description
Resource Object

The Resource.

query Object

Selection query.

opts Object <optional>

Configuration options.

Properties
Name Type Argument Default Description
with Array.<string> <optional>
[]

TODO

Source:
Returns:
Type
Promise

loadBelongsTo()

TODO

Source:
Returns:
Type
Promise

loadHasMany()

TODO

Source:
Returns:
Type
Promise

loadHasOne()

TODO

Source:
Returns:
Type
Promise

makeBelongsToForeignKey()

TODO

Source:
Returns:
Type
*

makeHasManyForeignKey()

TODO

There may be reasons why you may want to override this method, like when the id of the parent doesn't exactly match up to the key on the child.

Source:
Returns:
Type
*

update(Resource, id, props, opts)

Apply the given update to the record with the specified primary key.

Parameters:
Name Type Argument Description
Resource Object

The Resource.

id string | number

The primary key of the record to be updated.

props Object

The update to apply to the record.

opts Object <optional>

Configuration options.

Source:
Returns:
Type
Promise

updateAll(Resource, props, query, opts)

Apply the given update to all records that match the selection query.

Parameters:
Name Type Argument Description
Resource Object

The Resource.

props Object

The update to apply to the selected records.

query Object <optional>

Selection query.

opts Object <optional>

Configuration options.

Source:
Returns:
Type
Promise