Answers for "list databases mongodb"

8

show collections in mongodb

db.getCollectionNames()
Posted by: Guest on June-08-2020
9

mongodb show database command linux

show databases
show dbs
Posted by: Guest on May-29-2020
4

mongodb show database command linux

show collections
show tables
db.getCollectionNames()
Posted by: Guest on May-29-2020
0

how to see databases in mongodb

>show dbs
Posted by: Guest on April-13-2021
0

List mongo databases

using System;
using MongoDB.Driver;
using MongoDB.Bson;

namespace SimpleEx
{
    class Program
    {
        static void Main(string[] args)
        {
            var dbClient = new MongoClient("mongodb://127.0.0.1:27017");
            var dbList = dbClient.ListDatabases().ToList();

            Console.WriteLine("The list of databases are:");

            foreach (var item in dbList)
            {
                Console.WriteLine(item);
            }
        }
    }
}
Posted by: Guest on October-13-2021

Browse Popular Code Answers by Language