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
Description of running examples is confusing #19
Comments
Hello, the example directory contains helper functions, which requires module "mongo b". Just run 'npm install' in 'sample' directory :-) Tell mi if it works. Thanks! |
Yes both methods work after npm install (though there is a mongodb warning):
Results in two databases being created with the data:
I like the library, though I will say I found the setup a big confusing. There are 4 package.json files in the project (which ones need to be installed, some of them, all of them?), I had to clone the project and create a separate test project to test the javascript method (an included sample project might be a better way to go). How the helper functions work isn't all that clear to me after reading the docs. Feels like there could be some simplifications/docs improvements. Having said that, it's a neat library, mongodb data seeding is a pain point I've struggled with for a while. |
Thanks for reporting, I've created a separate issue for depreciation warning. Currently I'm on vacation without access to a computer, but 12 days later I will investigate the problem with creating two databases. Can anyone else confirm this? Normally you don't need to clone the repository at all. CLI and JS library for using is available in npm, and the Docker Image is in Docker hub registry. So you need to clone the repository if you want to try out the examples. All JS files for data import is pure Javascript - so you can do whatever you want, but you need to export an object of array of objects. If this is pure JS, it means that you can also import some dependencies in these files. Basically that's how the helper functions work - they are just dependencies stored in other directories (not evaluated for collections import). Does the answer satisfy you? How would you simplify the docs? Any idea will be very helpful. Thank you! |
I don’t think that having two databases created is necessarily an issue, in
fact having separate dbs created is sort of useful if you are trying each
example import method one after the other.
Is there a way to have the example data included in the files that get
downloaded on npm install?
I will have a think about doc ideas over the next few days.
…On Sat, 1 Sep 2018 at 16:31, Paweł Kosiec ***@***.***> wrote:
Thanks for reporting, I've created a separate issue for depreciation
warning.
Currently I'm on vacations, but 12 days later I will investigate the
problem with creating two databases. Can anyone else confirm this?
Normally you don't need to clone the repository at all. CLI and JS library
for using is available in npm, and the Docker Image is in Docker hub
registry. So you need to clone the repository if you want to try out the
examples.
All JS files for data import is pure Javascript - so you can do whatever
you want, but you need to export an object of array of objects. If this is
pure JS, it means that you can also import some dependencies in these
files. Basically that's how the helper functions work - they are just
dependencies stored in other directories (not evaluated for collections
import).
Does the answer satisfy you? How would you simplify the docs? Any idea
will be very helpful. Thank you!
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#19 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AB07z-7yOtWMU2ItqGtIFKUY51pwNfOyks5uWlPvgaJpZM4WVHAk>
.
|
Hmm, but wait - you probably configured a different name for MongoDB database in your test app. Is that right? So it isn't the issue of the library. No, sorry, but in npm packages there shouldn't be other files that essential ones. So examples don't fit there. |
I copied and pasted the code from the core page installation instructions.
It’s just a suggestion, from a library user perspective it would be nice to
only have to npm install once and have all the necessary parts to seed data
but also to run the examples.
It felt like I had to do too many things to install and run the examples,
and kind of confusing.
…On Sun, 2 Sep 2018 at 12:10, Paweł Kosiec ***@***.***> wrote:
Hmm, but wait - you probably configured a different name for MongoDB
database in your test app. Is that right?
No, sorry, but in npm packages there shouldn't be other files that
essential ones. So examples don't fit there.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#19 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AB07z5mBfYp8xvo1m85PAFNXX887kTs5ks5uW2hKgaJpZM4WVHAk>
.
|
Oh, okay - so this is not an issue, you have different database names in your sample program and CLI config. So two databases have been created because you ran data imports twice with different configuration. Everything is fine then 🙂 Hmm, so you're saying that the samples should be included in CLI installation, right? Do you know other tools or libraries which provide examples with binaries? |
Okay, I've just checked the docs for samples and there is nothing about running npm install in examples directory... Sorry for that! Once I return i will try to rewrite precisely the instructions for sample data import. |
You have the output of all the commands I ran in the thread. The only thing I didn't include was that I installed the cli as the initial step.
Did you expect me to do a different sequence of steps? Seems like there could be less steps just to take a test drive. I'm not all that familiar with how you have structured your app, sounds like you have some shared code between the cli and the main app. Is the cli a separate repo? As far as the binaries go I suppose you are referring to the docker images...I didn't go into the docker seeding method. |
Hey @mjgs, sorry for a delay! I just wanted to reply you when I have access to my computer.
No, the sequence is fine, I just didn't get that correctly (reading it on mobile phone) and I assumed that after one single run of seeding you got 2 created databases. That would be a serious bug, but turns out that everything is OK 🙂
It's not possible to reduce steps of running examples that much - cloning repository is a must have there. But I will create a sample JS file that uses
This repository contains code of CLI, library and Docker image. Docker image and CLI depends on
I was referring to essential files in other NPM packages. Because I haven't encounter any case where examples were included in a package. But never mind - let's summary what has to be done 🙂 SummaryHere is a pretty long discussion - I would like to close this issue and create another one like
What do you think? Will it satisfy you? Would you like to have another point in this list? |
Looks good, I can't think of anything else to add. I'll read and run through the instructions once they are updated. |
Great. Thank you very much for your feedback and the discussion! |
Looks like a great library, however I couldn't get either of the methods to import the example data to work. Am I doing something incorrectly?
The text was updated successfully, but these errors were encountered: