Why my mongodb-stitch service return me the value type ($numberLong, $numberInt,…)?

China☆狼群 提交于 2020-07-06 20:00:21

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!