# Retrieving Records with Remote Objects

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.

```javascript
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.

```javascript
var ct = new RemoteObjectModel();

// Empty callback functions for simplicity
ct.retrieve({where: {FirstName: {eq: 'Marc' }}}, function() {}); // query object

ct.retrieve(function(){
	return({where: {FirstName: {eq: 'Marc' }}});
}, function() {}); // function returning query object
```

See [Format and Options for Visualforce Remote Objects Query Criteria](/docs/platform/salesforce-pages-developers-guide/guide/pages-remote-objects-using-retrieve-query-object.md) 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.

:::note
All server operations that use Remote Objects are performed asynchronously. Any code that depends on the request being completed, including handling returned results, must be placed in the callback function.
:::

Your callback function can accept up to three arguments.

```javascript
function callback(Error error, Array results, Object event) { // ... }
```

See [Visualforce Remote Objects Callback Functions](/docs/platform/salesforce-pages-developers-guide/guide/pages-remote-objects-callback-functions.md) for details about writing Remote Objects callback functions.

To retrieve records using dates, pass in the JavaScript date object to the query.

```javascript
var myDate = new Date('2017-01-20');
ct.retrieve({where: {CloseDate: {eq: myDate}}}, function() {});
```

**See Also**

- [Format and Options for Visualforce Remote Objects Query Criteria](/docs/platform/salesforce-pages-developers-guide/guide/pages-remote-objects-using-retrieve-query-object.md)
- [Visualforce Remote Objects Callback Functions](/docs/platform/salesforce-pages-developers-guide/guide/pages-remote-objects-callback-functions.md)
