Skip to content

Exporting to JSON #2051

Answered by lbnascimento
justintoo asked this question in Q&A
Discussion options

You must be logged in to vote

@justintoo LiteDB has a way to export collections to JSON:

var db = new LiteDatabase(...);
db.Execute("select $ into $file('output.json') from mycollection");

You can use db.GetCollectionNames() to iterate through every collection if you want to export all of the collections.

Regarding using LiteDB in powershell, I have never done it but apparently it is possible.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by mbdavid
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants