-
Notifications
You must be signed in to change notification settings - Fork 49
results() returns document instead of array #41
Comments
@AdriaandeJongh Thanks! I will add that to the tests and see what's going on there. If I find it, I'll add a patch in the next fix. Maybe, for now, run a check to see if its a document or an array. |
I having same problem. The first result is array (no problem), but the next result is not array but Document object. I had to set cache to false to make this work. |
@aalfiann Can you confirm this is an issue when cache is set to true? Does it work on the first query, and then the second query (cached) does not? Which would mean its related to reading the cache. |
No, the cache is fine, It seems there is a problem in run() function. I'm not sure, but for temporary right now, I just disabled cache when use select(array) and everything is ok. |
@aalfiann Ok, thanks for confirming. I will look into this and see if there is a patch to be made. |
@AdriaandeJongh This has been resolved from a recent by fix by @faryar76 – Thanks again! |
The following query returns a single Document instead of an array if there is only 1 document that matches the query:
The docs state results() should always just return an array, so this was a hard catch ;)
The text was updated successfully, but these errors were encountered: