SDK
SDK Javascript v7.x
2

stop #

Available since 7.8.0

Stop observing documents and release associated ressources. Can be used either with:

  • a list of documents from a collection: stop observing those documents
  • an index and collection: stop observing all documents in the collection
  • no arguments: stop observing all documents in all collections

Arguments #

stop (index?: string, collection?: string, documents?: Array<{ _id: string; }>): Promise<void>
ArgumentTypeDescription
index
string
Index name
collection
string
Collection name
documents
{ _id: string; }[]
Array of documents

Usage #

Stop observing specified documents:

const observer = new Observer(sdk);

const taxis = await observer.mGet('nyc-open-data', 'yellow-taxi', ['foo', 'bar']);

await observer.stop('nyc-open-data', 'yellow-taxi', taxis);

Stop observing every documents of a collection:

const observer = new Observer(sdk);

let result = await observer.search('nyc-open-data', 'red-bus', {});

await observer.stop('nyc-open-data', 'red-bus');

Stop observing every documents:

const observer = new Observer(sdk);

const taxis = await observer.mGet('nyc-open-data', 'yellow-taxi', ['foo', 'bar']);

let result = await observer.search('nyc-open-data', 'red-bus', {});

await observer.stop();