mongodb通过子串查询ObjectId对应的record

select the records from collections post, whose _id contains substring '031'

db.post.find({$where: "/031/.test(this._id.str)"})



你可能感兴趣的:(mongodb,substring,where)