mbdavid / LiteDB

LiteDB - A .NET NoSQL Document Store in a single data file
http://www.litedb.org
MIT License
8.63k stars 1.25k forks source link

[QUESTION] What is the idiomatic way to create an empty collection? #1481

Open nightroman opened 4 years ago

nightroman commented 4 years ago

What is the idiomatic way to create an empty collection?

Maybe I missed some existing API but the only way I know is to add and remove a dummy document. Is there a better way to create an empty collection?

Use cases? They are rare of course but I am sure there are more than one.

I have a scenario in FarLite, the LiteDB browser in Far Manager:

mbdavid commented 4 years ago

Hi @nightroman, today there is no fancy way to do that, there is no CreateCollection method or some similar to that.

I will mark your question as suggestion, so I will discuss this with all team.

Yanitrix commented 3 years ago

@mbdavid Would adding a dummy document to a collection and then deleting it ensure that this collection exists and is empty?