Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nedb data export to excel/csv formats ? #518

Open
Technologeek opened this issue Jul 7, 2017 · 3 comments
Open

Nedb data export to excel/csv formats ? #518

Technologeek opened this issue Jul 7, 2017 · 3 comments

Comments

@Technologeek
Copy link

First off,Thanks @louischatriot for the amazing work on Nedb.I have been using Nedb on a project without any issues till date.I'm close to completing my project and I'm stuck at a following limitation of nedb.I need to export my data(data store) to either of text/csv format as according to my clients requirements.
Unlike nedb,monogodb provides an export method,almost all the major databases do.My question is : Does Nedb has a feature or a trick where I can export the data in the mentioned formats ? The way data is stored is not even complete JSON so using native javascript plugins don't help.Has anybody made it work yet ?
Thanks in Advance !

@marcusjwhelan
Copy link

You could simply write a method yourself to load in each obj to memory and pipe it out to JSON.

@JamesMGreene
Copy link
Contributor

By default, a persistent NeDB datafile's format is ndjson (newline-delimited JSON). However, the moment you add a custom afterSerialization and beforeDeserialization hook functions, that default format completely goes out the window at the whim of your hook functions.

But otherwise, @marcusjwhelan said it right: just create your own. It's pretty simple. You can publish them as standalone modules like nedb-export and nedb-import. MongoDB's mongoimport and mongoexport are external tools like that, too.

@xeoshow
Copy link

xeoshow commented Aug 29, 2018

Very helpful, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants