TechDawg270
TechDawg270

Reputation: 725

.NET implementation of MongoDB remove command

From the console this is as easy as running the command:

db.<collectionName>.remove();

This does not appear to be implemented as part of the .NET driver functionality. How can I produce similar functionality within a .NET\C# program? I have a staging collection that I want to remove all records from after processing

Upvotes: 0

Views: 42

Answers (1)

JohnnyHK
JohnnyHK

Reputation: 311935

Use RemoveAll to remove all records from a collection:

db.GetCollection("test").RemoveAll();

Upvotes: 1

Related Questions