0

how to check the second character match in mongoDB. in sql we are using like '_a%'. how to use in mongoDB??

sara
  • 1
  • 6
    You accomplish this by using a regex as answered by others: http://stackoverflow.com/questions/3305561/how-do-i-query-mongodb-with-like and – Martin4ndersen Sep 11 '16 at 13:29

1 Answers1

0

you should use syntax like below:-

db.users.find({"name": /.a./}) or like >> db.users.find({"name": /a/})

if you want to search for character "a"

angular.aditya
  • 115
  • 1
  • 1
  • 10