AWS-DocumentDB不支持$ lookup运算符,AWS-DocumentDB中$ lookup的任何替代方法

时间:2019-05-13 11:45:03

标签: node.js mongodb amazon-web-services mongoose aws-documentdb

DocumentDB不支持“ $ lookup”运算符,DocumentDB中$ lookup(MongoDB)的任何其他替代方案。

这是DocumentDB支持的运算符的列表。 https://docs.aws.amazon.com/documentdb/latest/developerguide/mongo-apis-aggregation-pipeline.html

将Nodejs应用程序从MongoDB迁移到DocumentDB,数据已成功迁移,但在运行该应用程序时出现此错误。

{ MongoError: Aggregation stage not supported: '$lookup'
at Connection.<anonymous> (/.../node_modules/mongoose/node_modules/mongodb-core/lib/connection/pool.js:443:61)
at emitTwo (events.js:126:13)
at Connection.emit (events.js:214:7)
at processMessage (/.../node_modules/mongoose/node_modules/mongodb-core/lib/connection/connection.js:364:10)
at TLSSocket.<anonymous> (/.../node_modules/mongoose/node_modules/mongodb-core/lib/connection/connection.js:533:15)
at emitOne (events.js:116:13)
at TLSSocket.emit (events.js:211:7)
at addChunk (_stream_readable.js:263:12)
at readableAddChunk (_stream_readable.js:250:11)
at TLSSocket.Readable.push (_stream_readable.js:208:10)
at TLSWrap.onread (net.js:607:20)
ok: 0,
errmsg: 'Aggregation stage not supported: \'$lookup\'',
code: 304,
name: 'MongoError',
[Symbol(mongoErrorContextSymbol)]: {} }

1 个答案:

答案 0 :(得分:1)

Amazon DocumentDB当前不支持$ lookup。

您可以在此处找到受支持的API /阶段/运算符的最新列表:https://docs.aws.amazon.com/documentdb/latest/developerguide/mongo-apis.html

另外,请检查以下各项以了解最新发布的内容:https://aws.amazon.com/documentdb/resources/