mongodb-stitch - 为什么我的 mongodb-stitch 服务返回值类型($numberLong,$numberInt,...)?

标签 mongodb-stitch

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

如何使用与 Compas 中相同的变量格式,或者如何使用 Stitch 处理这个问题?

Mongodb 缝合

enter image description here

指南针

enter image description here

最佳答案

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

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

当您执行您的函数时,响应会使用 EJSON 打印。 这就是为什么您会在结果选项卡上看到这样的回复,在您的回复底部是这样的:

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

关于mongodb-stitch - 为什么我的 mongodb-stitch 服务返回值类型($numberLong,$numberInt,...)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53320901/

相关文章:

javascript - mongodb stitch 返回所有字段

javascript - 如何修复 MongoDB Stitch 函数中的 "Result undefined"

jwt - 如何从 AWS Cognito JWT 中获取元数据以将其用于 MongoDB Stitch 元数据字段?

mongodb - 通过 stitch aws 服务将图像上传到 s3 失败

mongodb - 自定义身份验证如何在 MongoDB Stitch 中工作

mongodb - 在 Mongo-Atlas Stitch 中使用上下文时出错

mongodb - Stitch 函数 updateOne 错误 "update not permitted"

javascript - 出现错误 : 'Stich is not defined' in JavaScript password reset function