sorcery icon indicating copy to clipboard operation
sorcery copied to clipboard

MongoDB: authentications as embedded document

Open wclr opened this issue 12 years ago • 4 comments

Didn't you think when using MongoDB to allow external authentications to be an embedded collection in a User collection object, not a separate collection with references?

wclr avatar Nov 29 '11 14:11 wclr

+1 for external authentications using embedded relation using mongoid/mongodb :)

johansl avatar Jan 04 '12 01:01 johansl

Is it possible to find user by his embedded documents in MongoDB? I mean, if Twitter authentication is embedded, can I find user doing something like User.where("authentications.provider = 'twitter' and authentications.user_id = 'xxx')? If so, then it will be good idea. We're going to extract adapters for 1.0 release and maybe we'll be able to do it then.

arnvald avatar Mar 23 '14 09:03 arnvald

Ok, I've checked it, it's possible, it looks pretty esy to implement, I actually like the idea. The only problem is that it requires migrating data and changing models. Maybe we could do it for 1.0 release. @kirs, what do you think?

arnvald avatar Mar 28 '14 04:03 arnvald

I'm not that good with Mongo, but the proposal looks interesting.

kirs avatar Mar 28 '14 08:03 kirs