_design/execute_commandsThese views are used to track commands that are exported in the DB (available to be called). It also tracks commands which have arrived and have not yet completed.
export_commandsCommands which are available to be called in the database.
mapfunction(doc) {
if (!doc.type || doc.type != 'export_commands') return;
for (var k in doc.keys) {
emit(k, [doc.keys[k].Info, doc.uuid, doc.log_servers]);
}
}reduce: _countincomplete_commandsCommands which have not yet been completed.
mapfunction(doc) {
if (!doc.type || doc.type != 'command') return;
if (doc.response) return;
emit([doc.execute, doc._id], 1);
}reduce: _sumcomplete_commandsCommands which have been completed (have a response field).
mapfunction(doc) {
if (!doc.type || doc.type != 'command') return;
if (!doc.response) return;
emit([doc.execute, doc._id], 1);
}reduce: _sumexport_commandsmapfunction(doc) {
if (!doc.type || doc.type != 'export_commands') return;
for (var k in doc.keys) {
emit(k, [doc.keys[k].Info, doc.uuid, doc.log_servers]);
}
}reduce: _count(in)complete_commands).