LIKE模糊查询userName包含A字母的数据(%A%)
SQL:
SELECT * FROM UserInfo WHERE userName LIKE "%A%"
MongoDB:
db.UserInfo.find({userName :/A/})
LIKE模糊查询userName以字母A开头的数据(A%)
SQL:
SELECT * FROM UserInfo WHERE userName LIKE "A%"
MongoDB:
db.UserInfo.find({userName :/^A/})