Mongoose $lookup where localField is a string of an ObjectId in foreignField

前端 未结 1 1677
我寻月下人不归
我寻月下人不归 2021-01-15 11:15

I want to do a $lookup where the localField is a String representation of an ObjectId and the foreign field is an actual ObjectId.

Any idea if this is possible with

相关标签:
1条回答
  • 2021-01-15 11:58

    It is not possible to match string with ObjectId in $lookup in mongodb version 3.2, there are some tickets opened for this issue, you can follow these issue and also vote for them.

    https://jira.mongodb.org/browse/SERVER-22781

    https://jira.mongodb.org/browse/SERVER-24947

    0 讨论(0)
提交回复
热议问题