Can I store data from my signup view using two diferrent collections?

I know this is a stupid question but let me explain, there’s data such a username, password and email that come with the accounts package but in my app I also have extra fields that will be shown in my profile view so I want to know if I’m complicating myself with things and just call both collections, fill the inputs and store them in my database.

I created a profile collections because it’s not recommended to use the profile from Accounts.CreateUser.

Any tip or help is really appreciated.

I don’t know what’s exactly your problem is but this may help:


You can also use more than 1 subscriber or use method to get the data you need.

1 Like

Sorry if I confuse you, I’m using two collections for a single page, there are some inputs that belong to the meteor.users collection and rest belong to my profile collection, so my question is if I can fill all of the inputs without any trouble

You create a register form with all fields you need. On submit, call a meteor method on the server.
This method will create user and store other data.
call this to create user: https://docs.meteor.com/api/passwords.html#Accounts-createUser

All You Want To Do Is Adding some other fields to the predefined Accounts package fields. If i understand from your request.

To do this you need to add the field you want in the profile session. The Account packages allow Another field called Profile. In the profile, you can add whatever field you want.

Hope This Help!:blush::blush::blush:

1 Like

Thanks but I don’t want to use that field since it’s not secure enough from what I’ve been reading in the meteor docs.

Even though I’m using that method right now In my App. The only issues I’m facing is the required problem. The fields in the profile don’t really care about they requirements.
I’m working on this issues but I’m pretty Positive that is the only way if you want to create a profile before getting a User ID.

You can use Validation package for that. I’m currently using it and it works pretty well :blush::blush::blush:

1 Like

Only the profile field on the user document could be considered insecure, because it allows every modification coming from the registered user.
You can either prevent that by explicitly making changes denied (look for the documentation on allow/deny), or just store nothing in the default profile field but still use the rest of the user document safely.
No need for a second collection anyway :slight_smile:

2 Likes

Yeah you’re right, I was complicating myself with unnecessarily, in the end I just use Account.onCreateUser to modify it the way I want it. Thanks for the help :grinning:

1 Like