Skip to content

Instantly share code, notes, and snippets.

@shannonbradshaw
Last active July 31, 2016 19:44
Show Gist options
  • Save shannonbradshaw/5889127b1cb3be56dbc0d2f6456948ac to your computer and use it in GitHub Desktop.
Save shannonbradshaw/5889127b1cb3be56dbc0d2f6456948ac to your computer and use it in GitHub Desktop.
Task: Users with "m" in Their Name

Suppose you have a users collection in a database named people. Documents in the users collection resemble the following:

{
    _id: 1,
    name: "Gram Parsons",
    DOB: "1946-11-05"
}

In the mongo shell, how would you query this collection for all users that have an "m" somewhere in their name?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment