There are two ways to get a list of documents the user belongs to.
The main, recommended way to fetch documents is with the
You can also get all a user's documents with the
This function is used to fetch the user's documents in a paginated manner. This is the recommended way to fetch documents.
options(object) options to pass to the paginator
limit(number) how many entities to fetch with each request. This property is required.
orderBy('updatedAt' | 'createdAt') how the entities should be ordered when querying. Defaults to 'updatedAt', meaning documents that were most recently updated will be fetched first
orderDirection('ASC' | 'DESC') which direction the entities should be ordered when querying. Defaults to 'DESC' meaning newer documents are fetched first.
before(number - timestamp in MS) Sets the query to only fetch items that were updated/created at before this date. Used to fetch older documents. Defaults to the current time.
Returns a list of all the user's documents.
This API should not be used in large scale applications, as it does not scale up with the number of documents a user belongs to.