Open gadicc opened 8 years ago
Oh and jsdoc failed on my system too, must be something in the code somewhere (I've seen it break on some other ES6 stuff, and I used to a plugin to strip out e.g. async/await).
In theory there's no need for you to even maintain this, since the docs should be identical for any DB driver. But I'd be interested to see where it's breaking anyway.
Gadi, I could not make this work with a ready app as you load drivers automatically from the 'db/' directory. How do you foresee to include all custom drivers?
I really like textual ids as they work really well for optimistic updates. Do I understand well that you want to let users choose how to generate their ids?
To be honest I wrote the driver and I have a bit issues to set this up in a live app ;)
Oh wow that's really old code... are you running from npm? See if you can run from master via npm link
(I think I explained how in the CONTRIBUTING if you're not familiar with it). Otherwise I can publish something now, things are just a bit messy :> I refer to apollo-passport
and react
; local
is stable and published.
As for how to load DB drivers currently, you pass in an instance via the db
option to ApolloPassport, see the README on apollo-passport/master.
Let me know if anything else doesn't work; to my knowledge you're the first person besides me using this :>
Oh, and local
doesn't (currently) recognize Meteor stored passwords, but it wouldn't be too difficult to add that or use the same format (for the newer bcrypt stored passwords at least; no plans to go back to srp too).
I must be looking somewhere in the incorrect place. Your master in Apollo-passport has a last modification 20 days ago and it still uses directory recognition for drivers. Did you push your changes recently?
Where / which file?
There's a saturn-starter and meteor-starter now.
Oh and I also wanted to say how awesome it was that apollo-passport-mongodb
worked right out the box :) Good job! Will check out apollo-modules tomorrow.
Ah, no problemo ... ever since I worked with that repo I know how to setup coveralls and CI with CirceCI so now all my projects are very fancy so thanks for that. Also I am reusing your DB testing functionality so it was veeeeeeeery beneficial both ways ;)
Firstly I feel I have to repeat what I wrote in https://github.com/apollo-passport/apollo-passport/issues/1#issuecomment-241333184 :)
On the whole looks fantastic. A few very minor comments:
There were a few places where I guess you thought some choices were my own for styling, but were actually specific to rethinkdb:
m
in example -r
really is what RethinkDB recommends, I think the convention for MongoDB is justdb
right?_init()
and_ready()
- I was forced to do this because of how rethinkdb works, e.g. table assertion, which is problematic anyway as I think I wrote in the code somewhere. Because of how MongoDB works, I think you can get rid of all this stuff, if you want - unless you think it might be useful in the future (double check also with testing, but I think even in mongodb even databases are created on first write if they don't already exist).Config related stuff; I screwed this up, but it's not actually used anywhere yet. I'll let you know of final implementation (e.g. shouldn't destructure
data
since theid
field will overlap, doesn't update an existing config key, etc).In assertUserEmailData, is there any way to make the update atomic? I can foresee the (rare) situation where an email address is removed between the find and update, resulting in the wrong index being updated. Also, you update the existing record whereas I replace it... Updating is probably better but let me put some more thought into it (
assert
in the name for me implied an exact match, and was intended to keep functionality very basic; but updates would definitely super useful).For createUser, Meteor users will love this but I think that the default should be to use Mongo Object Ids. Maybe something like:
overriden with
Re _id mapping, sorry, I got confused with
mapUserToServiceData
. I think for now let's implement something like:and see how we go with it.
Thanks again for the quick work on this! Great to have a mongodb driver before the project is even officially announced :) :)