在mongodb中使用$ lookup字符串和objectId

时间:2018-11-28 09:36:34

标签: mongodb

如何在mongoDB 3.6版中使用$ lookup字符串和$ Objcectid。 如果在4.0版中有$ toObjectId,在3.6版中是否有类似的东西?

1 个答案:

答案 0 :(得分:0)

{ $toObjectId: <expression> }{ $convert: { input: <expression>, to: "objectId" } }