-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Stitch
-
Labels:None
Description
We need to update the blog html file to point to the latest JS SDK
blog html
https://github.com/mongodb/stitch-examples/blob/master/basic-blog/blog.html
Latest JS SDK
https://s3.amazonaws.com/stitch-sdks/js/bundles/4/stitch.js
Original Description
https://docs.mongodb.com/stitch/tutorials/build-blog/
Step 3 currently includes to toArray() function.
When I open the blog in Chrome I get the following error in my console:
TypeError: db.collection(...).find(...).toArray is not a function
at displayComments (blog.html:30)
When I change toArray to asArray, the code works as expected.
The full example at https://github.com/mongodb/stitch-examples/blob/master/basic-blog/blog.html uses asArray.
According to aydrian.howard: Use `asArray` for the SDK and `toArray` for Stitch functions