MyDB client component
MyDB client component.
$ npm install mydb-client
Compile with browserify.
var mydb = require'mydb''mydb.host.com';mydbget'/woot/woot';
Connects to the mydb server
If a parameter is not supplied it will connect to
Alternatively, an engine.io client options object can be supplied.
Document by subscribing to the supplied
url is optional, if a vanilla document is desired. See
Each document represents a subscription to a given resource URL.
Returns the associated manager.
Returns the sebscription id.
unloaded: no subscription (default when no
loading: loading a resource
loaded: resource is loaded
unloading: subscription is being destroyed
url this document is loaded from / loading.
Loads a document from the given URL. If
fn is supplied, it's passed
Reloads from the URL that was previously given to
Document#load. Useful if a given endpoint can return different documents depending on the circumstances. Example: a
/me route that returns the currently signed-in user.
Calls the supplied
fn when the resource is loaded. If the resource
is already loaded, the function is fired on the next tick.
Returns the value of the given
key, which can use dot
It throws if the document is not loaded.
fn is supplied,
ready is called first, and the value is passed
to the callback.
Subscribes to changes for the given
fngets called upon any operation.
valueproperty of the
logobject. For example, if the operation is a
$push, the value that's pushed is the first parameter.
after). For example, if the operation is acting on an array, like pushing, pulling or popping, you will still get the reference to the entire array.
logobject returned by mongo-query.
ready, then calls
fn with the initial value of the given
key, and subscribes to subsequent change events for
ready, then calls
fn for each value of the array found under
Destroys this subscription.
fn gets called when the unsubscription
for the current id is confirmed.