aheckmann / gridform

Stream formidable uploads into MongoDB GridFS
http://aheckmann.github.com/gridform/
MIT License
59 stars 17 forks source link

Enable passing existing Grid instance to gridform #12

Open LewisJEllis opened 9 years ago

LewisJEllis commented 9 years ago

I'm using gridform, and also using gridfs-stream itself. I have an existing Grid instance which I would like to be able to pass to gridform, but instead I have to pass the same db and mongo that I used to construct my Grid instance, and then gridform constructs its own Grid instance.

I've poked around a bit in both gridform and gridfs-stream and can't come up with any reason for gridform to need its own Grid instance. I'm happy to send a PR for this, but just want to have some discussion before doing so. I'm imagining just adding a grid field to options which, when provided, is used in place of db and mongo to populate __gridstream. Please let me know your thoughts.

Awk34 commented 9 years ago

Yeah, that seems reasonable to me.