Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
db.courses.find({"course_number":"/^AFPRL/"}) 什么也不返回。
以下是我的数据库条目。请原谅我,因为我对 MongoDB 很陌生。我相信我正在尝试在 MySQL 中执行相当于 LIKE 操作的操作?
{ _id: ObjectId("51072be2f046ed1c0e000000"), course_number: "AFPRL 100.00", room: "HW 215", }
正则表达式不是字符串。它应该是
db.courses.find({"course_number": /^AFPRL/})