Skip to content

Instantly share code, notes, and snippets.

@treygriffith
Created January 22, 2013 22:14
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save treygriffith/4599072 to your computer and use it in GitHub Desktop.
Save treygriffith/4599072 to your computer and use it in GitHub Desktop.
Demonstrate behavior of MongoDB $in on Array properties
toy1 = {
color: ['red', 'purple']
};
toy2 = {
color: ['pink', 'orange']
}
Toys.find({color: { $in: ['red', 'green', 'blue'] }}, cb);
// finds toy1, but not toy2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment