为什么我的mongodb-stitch服务会向我返回值类型($ numberLong,$ numberInt等)? [英] Why my mongodb-stitch service return me the value type ($numberLong, $numberInt,…)?

查看:372
本文介绍了为什么我的mongodb-stitch服务会向我返回值类型($ numberLong,$ numberInt等)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么我的mongodb-stitch服务向我返回值的类型($ numberLong,$ numberInt等),而Compass应用程序却没有呢?

Why my mongodb-stitch service return me the type of value ($numberLong, $numberInt,…) while the Compass application do not do ?

如何具有与Compas中相同的可变格式,或如何使用Stitch处理呢?

How to have the same varialble format like in Compas or how to handle this with Stitch ?

在此处输入图片描述

在此处输入图片描述

推荐答案

MongoDB Stitch函数可以访问通过各种全局变量提供的实用程序包.

MongoDB Stitch functions have access to utility packages provided through various global variables.

其中一些如下: https://docs.mongodb.com/stitch/functions/utilities/
JSON
EJSON
BSON

And some of them are below: https://docs.mongodb.com/stitch/functions/utilities/
JSON
EJSON
BSON

当您执行函数时,响应将使用EJSON打印. 因此,您会在结果底部的结果选项卡上看到这样的响应:

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:

结果(JavaScript): EJSON.parse('[{"_ id":{"$ oid":"5bf9302f72a975ed8229fdf4"},"rating":{"$ numberDouble":"5"},{...

result (JavaScript): EJSON.parse('[{"_id":{"$oid":"5bf9302f72a975ed8229fdf4"}, "rating": {"$numberDouble": "5"}, {...

这篇关于为什么我的mongodb-stitch服务会向我返回值类型($ numberLong,$ numberInt等)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆