Also, console.log (count) returns NULL… ???
Ok, this is a little bit strange.
I would first check the following things…
-
Check my DATABASE —> are the same items in my LIVE-Database as in Previewmode? (Databases are synced?)
Because if not, perhaps you look at the preview-database, which can have 446-items, but your live database is empty. Or vise versa. -
Check also the database-permissions, perhaps they block your code.
-
Check Read & Write options (already mentioned by J.D.).
-
Delete all other code, like J.D. said before and just do a simple test with related code-part.
-
Perhaps take a look again at my example, which works without any errors again and try to reconstruct exactly the same situation.
-
Also check the right options and connection of your dataset.
And if nothing helps, than i would do the next step and post it into “rolling out improvements”.