Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/delphi/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
将MongoDB迁移到DynamoDB_Mongodb_Migration_Amazon Dynamodb - Fatal编程技术网

将MongoDB迁移到DynamoDB

将MongoDB迁移到DynamoDB,mongodb,migration,amazon-dynamodb,Mongodb,Migration,Amazon Dynamodb,遵循这一思路 我已经按照步骤进行了操作,并且我正在接收DynamoDB无法接收的输出 例如,如果我将其导出为JSON,如果导出文件在MongoDB中有一个用int表示的字段,则导出文件会将其写入$numberprint。 例如:如果我在JSON中有一个字段 {a: 10} 它将编译为: {a: {$numberInt: "10"}} 有什么我遗漏的吗?除了将JSON文件从$numberprint解析为普通int之外,还有其他简单的解决方案吗 谢谢我不确定您的箱子和技术堆栈。在我的例子中,编译

遵循这一思路

我已经按照步骤进行了操作,并且我正在接收DynamoDB无法接收的输出

例如,如果我将其导出为JSON,如果导出文件在MongoDB中有一个用int表示的字段,则导出文件会将其写入$numberprint。 例如:如果我在JSON中有一个字段

{a: 10}
它将编译为:

{a: {$numberInt: "10"}}
有什么我遗漏的吗?除了将JSON文件从$numberprint解析为普通int之外,还有其他简单的解决方案吗


谢谢

我不确定您的箱子和技术堆栈。在我的例子中,编译的JS对象应该如下所示:

{ a: { 'N': '10' } }
如果您使用JS处理数据,则可以使用
dynamodb auto marshaller
转换JS对象:

import { Marshaller } from '@aws/dynamodb-auto-marshaller'

const data = { a: 10 }
const converter = new Marshaller()
const result = converter.marshallItem(data)

// result = { a: { 'N': '10' } }

希望这对您有所帮助。:)

那看起来会有用的!但是我们做了一个递归函数,按照Mongo理解的方式编译JSON:\