LoopbackClient Class
Loopback Client to access to PersistedModel (or extenders)
see http://docs.strongloop.com/display/public/LB/PersistedModel+REST+API see also http://apidocs.strongloop.com/loopback/#persistedmodel
Item Index
Methods
count
-
[where]
Return the number of records that match the optional "where" filter.
Parameters:
-
[where]
Object optional
Returns:
create
-
data
Create new instance of Model class, saved in database
Parameters:
-
data
Object
Returns:
destroy
-
data
Destroy model instance
Parameters:
-
data
Object
Returns:
destroyById
-
id
Destroy model instance with the specified ID.
Parameters:
-
id
String
Returns:
exists
-
id
Check whether a model instance exists in database.
Parameters:
-
id
String
Returns:
find
-
filter
Find all model instances that match filter specification.
Parameters:
-
filter
Object
Returns:
findById
-
id
Find object by ID.
Parameters:
-
id
String
Returns:
findOne
-
filter
Find one model instance that matches filter specification. Same as find, but limited to one result
Parameters:
-
filter
Object
Returns:
request
-
path
-
params
-
http_method
sends request to Loopback
Parameters:
-
path
String -
params
Objectrequest parameters
-
http_method
String{GET|POST|PUT|DELETE}
Returns:
setAccessToken
-
[accessToken]
sets Access Token
Parameters:
-
[accessToken]
String optionalAccess Token
Returns:
updateAll
-
where
-
data
Update multiple instances that match the where clause
Parameters:
-
where
Object -
data
Object
Returns:
updateAttributes
-
data
Update set of attributes.
Parameters:
-
data
Object
Returns:
upsert
-
data
Update or insert a model instance The update will override any specified attributes in the request data object. It won’t remove existing ones unless the value is set to null.
Parameters:
-
data
Object