Collection total says 0 if single object is returned instead of an array

The collection “Total” value says 0, even if a single object is returned.

It appears that the “Total” value only counts the records if an array is returned.

Should it be like this?

It seems to me that if a single record is returned {}, then the total value should count 1.

Not sure what the larger implications of that are. Or, if not, what should I be using to determine if a record was returned?

I’ve been using the “Total” value to determine if a collection is empty, but I just realized this will not always work.

Hey @kevinwasie :wave:

Total gives you the total number of records with the pagination. IMO, you should use length for this use-case (which takes only the current array into account)