Retrieve records by calling retrieve() on a Remote Objects model instance.
retrieve() requires two
arguments, one for query criteria and one for a callback handler.
RemoteObjectModel.retrieve({criteria}, callback_function)
criteria can be a
Remote Objects query object or a function that returns one. The following
two calls are equivalent.
var ct = new RemoteObjectModel();
ct.retrieve({where: {FirstName: {eq: 'Marc' }}}, function() {});
ct.retrieve(function(){
return({where: {FirstName: {eq: 'Marc' }}});
}, function() {});
See
Format and Options for Remote Objects Query Criteria for an explanation of the query object.
retrieve() doesn’t
return a result directly. The callback function enables you to handle
the server response asynchronously.
Your callback function
can accept up to three arguments.
function callback(Error error, Array results, Object event) {
See
Remote Objects Callback Functions for details about writing
Remote Objects callback functions.