"_id" : ObjectId("5b9f472a20f7a27d8ae2ab48"),
db.getCollection('col_cost').find({_id:ObjectId("5b9f472a20f7a27d8ae2ab48")})
如何通过调用“ e2ab48”找到此文档?
Mongodb版本3.4.2和我的收藏集https://jsoneditoronline.org/?id=c76174b321e545ba82fc2dd785ff3513我想打电话给CostId。我可以用6位数字的字符串找到这笔费用吗?
使用$where
db.getCollection('col_cost').find({ $where: "this._id.str.match(/.*e2ab48/)" })