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)]: {} }发布于 2019-05-14 08:53:01
更新10/16亚马逊DocumentDB如何支持$lookup:https://aws.amazon.com/about-aws/whats-new/2019/10/amazon-documentdb-add-additional-aggregation-pipeline-capabilities/
您可以在以下位置找到支持的API/stage/运算符的最新列表:https://docs.aws.amazon.com/documentdb/latest/developerguide/mongo-apis.html
此外,请检查以下最新发布的内容:https://aws.amazon.com/documentdb/resources/
https://stackoverflow.com/questions/56111625
复制相似问题