spencermountain / dumpster-dive

roll a wikipedia dump into mongo
Other
240 stars 46 forks source link

db_url is always taken from config.js #92

Closed Vid201 closed 3 years ago

Vid201 commented 3 years ago

In the README.md, there is an example with db_url: dumpster({ db_url: 'mongodb://localhost:27017/' }, () => console.log('done!'));. But in src/lib/open-db.js url is always created from config.db_url and options.db, which means db_url from options cannot be used.

spencermountain commented 3 years ago

ah, sorry bout that, wanna do a pr?

Vid201 commented 3 years ago

Sure. But I am not quire sure what would be the best solution, because of the query string in database url: https://docs.mongodb.com/manual/reference/connection-string/.

Example: mongodb://user:password@localhost:27017/?authSource=admin.

I think it's okay to set url just to options.db_url (if it is set) and omit database name while connecting (as far as I know it is not necessary). What do you think?

spencermountain commented 3 years ago

sounds good! I appreciate your help.