I am currently working on my first AngularJs + Meteor app. In this app, user can either register using $meteor.createUser or can use Facebook to login i.e. $meteor.loginWithFacebook. After logging in, on one page I am displaying user's friends from Facebook who have used this app. If user has logged in using Facebook then that page is working properly. But if user has registered using normal Meteor login [$meteor.createUser], then on that page I have to display Login with Facebook button. When user logs in with Facebook on this page, it is creating new document in users collection. But I am using Meteor.userId() as primary key in all tables. So I have following options:
Option 1:
- delete current document of user [_id no 1]
- log in with Facebook
- change _id of a document created while logging with facebook to _id no 1
Option 2:
- Assign "_id no 1" to user while he registers using Facebook
But I have not found any way to do so. How to do it? I am not able to change _id of document present in users collection. Please help. Thank you in advance.