问题
Why my mongodb-stitch service return me the type of value ($numberLong, $numberInt,…) while the Compass application do not do ?
How to have the same varialble format like in Compas or how to handle this with Stitch ?
Mongodb-stitch
enter image description here
Compass
enter image description here
回答1:
MongoDB Stitch functions have access to utility packages provided through various global variables.
And some of them are below: https://docs.mongodb.com/stitch/functions/utilities/
JSON
EJSON
BSON
When you execute your function, response prints with EJSON. Thats why you see your response like this at result tab, in the bottom of your response like that:
result (JavaScript): EJSON.parse('[{"_id":{"$oid":"5bf9302f72a975ed8229fdf4"}, "rating": {"$numberDouble": "5"}, {...
来源:https://stackoverflow.com/questions/53320901/why-my-mongodb-stitch-service-return-me-the-value-type-numberlong-numberint