Litedb: [QUESTION] What is the idiomatic way to create an empty collection?

Created on 15 Feb 2020  路  1Comment  路  Source: mbdavid/LiteDB

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:

  • User creates an empty collection for whatever reason and it is shown in the UI.
  • User may exit the session. In the next session the new collection should exist.
  • Then User opens the collection and adds new documents either using the editor
    with JSON (done) or copies existing documents from other collections
    (planned) (UPDATE: also done).
question suggestion

Most helpful comment

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.

>All comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kuiperzone picture kuiperzone  路  4Comments

sandolkakos picture sandolkakos  路  3Comments

thecodrr picture thecodrr  路  4Comments

dangershony picture dangershony  路  3Comments

furesoft picture furesoft  路  4Comments