SDK
SDK Javascript v5.x
1

You are currently looking at the documentation of a previous version of Kuzzle. We strongly recommend that you use the latest version. You can also use the version selector in the top menu.

scrollSpecifications #

Returns a JSON object containing the next page of the scroll session, and the scrollId to be used in the next scroll action.
A scroll session is always initiated by a searchSpecification action with the scroll argument.


scrollSpecifications(scrollId, [options], callback) #

ArgumentsTypeDescription
scrollIdstringThe "scrollId" provided with the last scrollSpecifications response or from the initial searchSpecifications request
optionsJSON objectOptional parameters
callbackfunctionCallback handling the response

Options #

OptionTypeDescriptionDefault
queuablebooleanMake this request queuable or nottrue
scrollstringRe-initializes the scroll session timeout to its value. If not defined, the scroll timeout is defaulted to a Kuzzle configurationundefined

Usage #

// Using callbacks (NodeJS or Web Browser)
kuzzle
  .collection('collection', 'index')
  .scrollSpecifications(scrollId, {scroll: '1m'}, function (err, res) {
    res.hits.forEach(function (specification) {
      console.log(specification);      
    });
    res.total // Total specifications count
  });
// Using promises (NodeJS only)
kuzzle
  .collection('collection', 'index')
  .scrollSpecificationsPromise(scrollId, {scroll: '1m'})
  .then(res => {
    res.hits.forEach(specification => {
      console.log(specification);
    });
    res.total // Total specifications count
  });

Callback response

{
  "hits": [{ "first": "specification" }, { "second": "specification" }],
  "total": 2
}