我應該會找到一個的ObjectId作爲主鍵的文件:通過ObjectId查找Mongodb我是否在查詢中使用字符串或ObjectId?
this._db
.collection('users')
.find({ _id: 'aaaaa0000000000000000000' })
.toArray();
或
this._db
.collection('users')
.find({ _id: ObjectId('aaaaa0000000000000000000') })
.toArray();
看到這個 https://stackoverflow.com/questions/45617525/mongodb-query-find-all-by-userid/45618622#45618622 – elcabezon