concept user ID in category meteor

appears as: user ID, user ID
Meteor in Action

This is an excerpt from Manning's book Meteor in Action.

It’s impossible to create a new message document from the browser unless an allow callback returns true. Only logged-in users should be able to send a message, so we need to return true when the user trying to insert a new document has a user ID (see listing 6.12). Guests don’t have a user ID and therefore their value for userId would return false.

Storing data inside a database takes a relatively long time, depending on network connections and write speeds. Figure 7.4 illustrates how methods are used to apply security and increase the perceived speed of write operations. First, a user submits a new workout. An event handler receives the data and passes it to a client method. This method will perform data validation to check whether the distance entered is valid. If all checks are passed, it simulates storing data to the database by adding it to the local Minimongo instance and updates the screen for the user. This happens in a fraction of a second, because all events take place in the memory of the local computer or mobile device. But now the data is sent to the server, where the same method will be executed. Some server-specific checks might be added as well, such as making sure the user ID is correct. If all validations pass, data is stored in the database and success is confirmed to the client.