mongodb show database command linux

#include <stdio.h>
#include <stdlib.h>

int main() {
    system("mongo --eval 'db.runCommand({ listDatabases: 1 })'");
    return 0;
}