简体   繁体   中英

Integrating Meteor js with existing user system

I'm brand-spanking-new to Meteor and I would like to integrate it with my existing system that is powered by a MongoDB. I see that meteor has an accounts-facebook and accounts-twitter package to help me with authenticating on these services which is what my existing system does.

The problem is that I already have a format for my users collection. I don't mind adding additional fields for the data I don't have but I rather have meteor use the fields I already have defined. Ie: username and email.

So,

a) How do I use meteor to connect to an existing db while in development?

b) How do I tell meteor which fields to use for username and email?

a) How do I use meteor to connect to an existing db while in development?

Currently there is no official support for SQL system, assuming that you're one. Meteor recently acquired FathomDB and we can't expect SQL support soon, Redis is coming sooner I believe.

b) How do I tell meteor which fields to use for username and email?

An easy solution is to insert create accounts for all users and when you create a user you use the same ID. Why? When you use subscriptions you make use of this.userId which is the Id of Meteor.users. On time I had different ids for the same user and fields pointing to the other Id but It wasn't a good approach.

With this solution, I'm assuming that you're going to use MongoDB, for any other databases: you'll have to be very patience. I would love to be using CouchBase today with Meteor but I don't think that this is going to have any time soon. SQL systems are going have better luck maybe next year.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM