Ok… I know it’s confusing so I’ll try to put some sense into it by breaking it into three subject:
- Wix Members
- Wix Code
- Collections and site database
Every Wix site can you the Site Members functionality (regardless of Wix Code).
This means, that when you add a Login/Signup button to your site, users can register, and somewhere in the Wix server there’s a database that hold that information.
Now,
The basics of Wix Code is having APIs to communicate with Wix features.
So, looking at the Wix Users feature, you now have the API listed in wixUsers , which does not contain a function as ‘getAllUsers()’, but do contain ‘getCurrentUser()’, which returns information about the user that is currently logged in to your site (of course, per computer).
The third part is Database collection.
Just as ‘Wix Members’, databases have an API for code described mostly by wixData (but is also accessible using dataset).
This allows you to create and manage your own data.
So, let’s say we want to save some data regarding our users in the site (for example, their age).
The flow will be as follows:
User gets to signup page (using a button that we added) → a User entry is created in Wix Members (automatically, nothing we need to do) → We ask the user for his age (using a page we created with some sort of input) → we save the info to database (using wixUsers.getCurrentUser() and wixData.insert()).
So what we get actually, is a way for us to save extra info about a signed in users, in terms of database that saves submissions.
But, if an existing user does not submit data, then he won’t appear in our database, and, we can add rows to that database, but this doesn’t mean that a user is created for the site.
For example, I can do to my database and add a row:
USER AGE
liran@someemail.com 32
But still, if the user ‘liran@someemail.com’ hasn’t registered to the site, he will have to go through the signup process when he arrives.
Hope this makes it a bit clearer.
Liran.