Taussy10Original post
Rank 2: Process
So, I'm trying to fetch the data from database and for some reason I'm seeing different things in console
by returning promise I'm getting: [[object]] and by returning promise.document I'm getting [array] why ?
You can see in chapters key in both the images
Summary
Issue with fetching documents from the database.
Returned data is not consistent when logging `promise` vs `promise.documents`. Check if a relation is being used and log separately if so. The data is displayed differently in the console, with `[array]` shown when retrieving `promise.document` and `[[object]]` shown for `promise`. This inconsistency is evident in the chapters key of both data representations.
Solution: The issue arises from logging the `promise` object which likely includes nested objects. To access the data in `promise.documents`, focus directly on that property for consistent output.