Exporting to JSON #2051
-
The LiteDB Explorer has an export to JSON functionality, but I'm wondering if there's an API available in LiteDB itself to export to JSON or convert the BSON to JSON? I'm specifically looking for a PowerShell solution. |
Beta Was this translation helpful? Give feedback.
Answered by
lbnascimento
Aug 9, 2021
Replies: 1 comment
-
@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 Regarding using LiteDB in powershell, I have never done it but apparently it is possible. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
mbdavid
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@justintoo LiteDB has a way to export collections to JSON:
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.