Core API#

RebasedCore#

Kind: global class
Implements: RebasedBridge

rebasedCore.reset() โ‡’ RebasedCore#

Reset the chaining configuration on the fly

Kind: instance method of RebasedCore

rebasedCore.get([path]) โ‡’ Observable.<T>#

Get a document

Kind: instance method of RebasedCore

ParamTypeDefault
[path]string"''"

rebasedCore.post([path], [body]) โ‡’ Observable.<T>#

Post document

Kind: instance method of RebasedCore

ParamTypeDefault
[path]string"''"
[body]*{}

rebasedCore.patch([path], [body]) โ‡’ Observable.<T>#

Patch a document

Kind: instance method of RebasedCore

ParamTypeDefault
[path]string"''"
[body]*{}

rebasedCore.delete([path], [body]) โ‡’ Observable.<T>#

Delete a document

Kind: instance method of RebasedCore

ParamTypeDefault
[path]string"''"
[body]*

rebasedCore.find() โ‡’ Observable.<T>#

Find documents

Kind: instance method of RebasedCore

rebasedCore.findOne() โ‡’ Observable.<T>#

Same as find but only one result is returned

Kind: instance method of RebasedCore

rebasedCore.set(data, [options]) โ‡’ Observable.<T>#

Create a document

Kind: instance method of RebasedCore

ParamType
data*
[options]SetOptions

rebasedCore.update(data) โ‡’ Observable.<T>#

Update document

Kind: instance method of RebasedCore

ParamType
data*

rebasedCore.on() โ‡’ Observable.<T>#

Get documents in realtime

Kind: instance method of RebasedCore

rebasedCore.count() โ‡’ Observable.<number>#

Count documents

Kind: instance method of RebasedCore

rebasedCore.run() โ‡’ Observable.<number>#

Run cloud functions

Kind: instance method of RebasedCore

rebasedCore.from(driver) โ‡’ RebasedCore#

Modify the driver to be used on the fly

Kind: instance method of RebasedCore

ParamType
driverRebasedDriverOption

rebasedCore.http(fn) โ‡’ RebasedCore#

Modify http request config on the fly

Kind: instance method of RebasedCore

ParamType
fnfunction

Example

import { fetch } from '@rebased/core';
fetch('kitty', {
baseURL: 'https://api.thecatapi.com',
endpoint: '/v1'
})
.http((config)=> { // modify axios config
config.headers['Authorization'] = 'Bearer xyz';
})
.get('/images/search?size=small&mime_types=gif')
.subscribe(
kitty => console.log(kitty),
err => console.log(err)
);

rebasedCore.network(active) โ‡’ RebasedCore#

Choose whether or not to make a network request

Kind: instance method of RebasedCore

ParamType
activeboolean

rebasedCore.cache(active) โ‡’ RebasedCore#

Choose whether to use memoized results

Kind: instance method of RebasedCore

ParamType
activeboolean

rebasedCore.state(active) โ‡’ RebasedCore#

Choose whether to use cached results

Kind: instance method of RebasedCore

ParamType
activeboolean

rebasedCore.key(name) โ‡’ RebasedCore#

Define a custom key to be used as a identifier for the result set

Kind: instance method of RebasedCore

ParamType
namestring

rebasedCore.query(by) โ‡’ RebasedCore#

Define a custom query

Kind: instance method of RebasedCore

ParamType
byobject

rebasedCore.where(field, operator, value) โ‡’ RebasedCore#

Constraint results

Kind: instance method of RebasedCore

ParamType
fieldstring
operatorstring
value*

rebasedCore.sort(by) โ‡’ RebasedCore#

Sort data

Kind: instance method of RebasedCore

ParamType
byobject

rebasedCore.size(value) โ‡’ RebasedCore#

Define the size of results

Kind: instance method of RebasedCore

ParamType
valuenumber

rebasedCore.at(value) โ‡’ RebasedCore#

Set an at pointer for the request

Kind: instance method of RebasedCore

ParamType
value*

rebasedCore.after(value) โ‡’ RebasedCore#

Set an after pointer for the request

Kind: instance method of RebasedCore

ParamType
value*

rebasedCore.ref(path) โ‡’ RebasedCore#

Define a document path for a request

Kind: instance method of RebasedCore

ParamType
pathstring

rebasedCore.doc(value) โ‡’ RebasedCore#

Define a document id for the request

Kind: instance method of RebasedCore

ParamType
value*

rebasedCore.include(fields) โ‡’ RebasedCore#

Populate query fields

Kind: instance method of RebasedCore

ParamType
fieldsArray.<string>

rebasedCore.master(active) โ‡’ RebasedCore#

Set useMasterKey on the request

Kind: instance method of RebasedCore

ParamType
activeboolean

rebasedCore.token(session) โ‡’ RebasedCore#

Set a session token for the request

Kind: instance method of RebasedCore

ParamType
sessionstring

rebasedCore.object(active) โ‡’ RebasedCore#

Result as real objects

Kind: instance method of RebasedCore

ParamType
activeboolean

rebasedCore.select(value) โ‡’ RebasedCore#

Select custom fields

Kind: instance method of RebasedCore

ParamType
valueArray.<string>

rebasedCore.near(field, geopoint, geopoint) โ‡’ RebasedCore#

Near geo query

Kind: instance method of RebasedCore

ParamType
fieldstring
geopointParse.GeoPoint
geopointParseOptions.GeoPoint

Example

fetch('locations').near('locationField', geopoint(40.0, -30.0)).find()

rebasedCore.withinKilometers(active, geopoint, maxDistance, sorted) โ‡’ RebasedCore#

Within Kilometers

Kind: instance method of RebasedCore

ParamType
activestring
geopointParseOptions.GeoPoint
maxDistancenumber
sortedboolean

Example

fetch('locations').withinKilometers('locationField', geopoint(40.0, -30.0)).find()

rebasedCore.withinMiles(active, geopoint, maxDistance, sorted) โ‡’ RebasedCore#

Within Miles

Kind: instance method of RebasedCore

ParamType
activestring
geopointParseOptions.GeoPoint
maxDistancenumber
sortedboolean

Example

fetch('locations').withinMiles('locationField', geopoint(40.0, -30.0)).find()
will return a field

rebasedCore.diff(fn) โ‡’ RebasedCore#

diff function callback

Kind: instance method of RebasedCore

ParamType
fn*

rebasedCore.response(fn) โ‡’ RebasedCore#

network response callback

Kind: instance method of RebasedCore

ParamType
fn*