4

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)]: {} }
4

1 回答 1

2

[10/16 更新] Amazon DocumentDB 如何支持 $lookup:https ://aws.amazon.com/about-aws/whats-new/2019/10/amazon-documentdb-add-additional-aggregation-pipeline-capabilities/

您可以在此处找到支持的 API/stages/operators 的最新列表:https ://docs.aws.amazon.com/documentdb/latest/developerguide/mongo-apis.html

此外,请查看以下内容以了解最近的发布:https ://aws.amazon.com/documentdb/resources/

于 2019-05-14T00:53:01.233 回答