duplicates

Members

(inner, constant) config

Source:

See https://github.com/kobotoolbox/enketo-express/blob/master/tutorials/60-duplicates.md for more information about this tool.

MAKE A BACKUP BEFORE RUNNING THIS SCRIPT TO REMOVE DUPLICATES!

Methods

(inner) checkDuplicateEnketoIds() → {Promise.<undefined>}

Source:

Generates a rapport about duplicate Enketo ids.

Returns:

A promise that resolves with undefined.

Type
Promise.<undefined>

(inner) getAllKeys() → {Promise.<(Error|Array.<string>)>}

Source:

Returns all keys.

Returns:

a list of keys.

Type
Promise.<(Error|Array.<string>)>

(inner) getDuplicates() → {Promise.<Array.<string>>}

Source:

Returns a list of duplicate Enketo ids.

Returns:

A promise that resolves with an array of keys.

Type
Promise.<Array.<string>>

(inner) getId(key) → {Promise.<(Error|{key: string, id: string})>}

Source:

Gets id from key.

Parameters:
Name Type Description
key string

The key for which an enketoId sought.

Returns:

A promise that resolves with key and id object.

Type
Promise.<(Error|{key: string, id: string})>

(inner) getSurveyOpenRosaId(duplicate) → {Promise.<(Error|object)>}

Source:

Gets the OpenRosaId belonging to a duplicate.

Parameters:
Name Type Description
duplicate object

Duplicate database entry.

Returns:

A promise that resolves with id and openRosaId object

Type
Promise.<(Error|object)>

(inner) remove(key, id) → {Promise.<(Error|string)>}

Source:

Removes an item from the main database.

Parameters:
Name Type Description
key string

The key to remove from the main database.

id string

The enketoId belonging to the database item.

Returns:

A promise that resolves with a message.

Type
Promise.<(Error|string)>

(inner) removeCache(key)

Source:

Removes an item from the cache database.

Parameters:
Name Type Description
key string

The key to remove from the cache database.

(inner) removeDuplicateEnketoIds() → {Promise.<undefined>}

Source:

Removes duplicate Enketo ids.

Returns:

A promise that resolves with undefined

Type
Promise.<undefined>