10

I started using MongoDb in Scala via Casbah but cannot find on the Casbah documentation / google the way to drop the content of a collection. The MongoDd doc says the MongoDb shell command to do so is

db.things.remove({}); 

But how can we achieve the same via Casbah?

Thanks in advance,

Olivier

Philipp
  • 67,764
  • 9
  • 118
  • 153
jolivier
  • 7,380
  • 3
  • 29
  • 47
  • Excuse my nitpicking, but it's called a collection in MongoDB, not a table. I took the freedom to edit your question accordingly. – Philipp Sep 06 '12 at 07:35

1 Answers1

13

Casbah's equivalent to the shells {} empty document operator is `MongoDBObject.empty

This should work -

db.things.remove(MongoDBObject.empty)
Brendan W. McAdams
  • 9,379
  • 3
  • 41
  • 31