0

I'm using casbah to find collection names in a mongodb-database

    val mongoClient = MongoClient()
    val db = mongoClient("db_name")
    val coll = db.collectionNames()

It also gives 'system.indexes' because each mongo database has that one. Is there any way to get rid from this ?

Shashika
  • 1,606
  • 6
  • 28
  • 47

1 Answers1

4

You have to filter it by yourself.

val coll = db.collectionNames().filterNot(_.startsWith("system."))
Tim Green
  • 3,571
  • 2
  • 23
  • 23