To invite users to a document, use the
usersToInvite is an array of emails or user IDs to invite. If an email is entered which does not belong to a user, an anonymous user will be created for that email. When the user signs up with that email, the document will already exist in their account.
If email notifications are setup, an email will be sent to each user saying they were added to a document.
A custom invite strategy can be set to determine what happens when a user is invited that is not in your database.
See invite strategies for more info.
If a document is public, then any user may join that document at any time. See more info about public documents here.