What is the equivalent command in MongoDB for the following SQL query?
SELECT * FROM posts WHERE author like "%john%"
db.posts.find( { author: /John/ } )
db.posts.find( { author: /AjohnA/ > )
db.posts.find( { $like: {author: /John/} } )
db.posts.find( { author: {$like: /John/} } )
Submit