New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

$contains and $containsAny #120

Merged
merged 2 commits into from Mar 25, 2015
Jump to file or symbol
Failed to load files and symbols.
+3,330 −3,322
Diff settings

Always

Just for now

Viewing a subset of changes. View all
Prev

Refactored contains and containsAny code

Added contains and containsAny example
  • Loading branch information...
KimSchneider committed Mar 25, 2015
commit 1f08433203554ccf00b381cbea4e72e25e62d5da
View
@@ -89,7 +89,8 @@ window.runExample = function () {
// create an example project
var prj = projects.insert({
name: 'LokiJS',
owner: stan
owner: stan,
tags: ['critical', 'public']
});
// query for user
@@ -135,6 +136,18 @@ window.runExample = function () {
trace(users.where(function (obj) {
return obj.age > 30;
}));
trace('Example: $contains and $containsAny');
trace(projects.find({
'tags': {
'$contains': [ 'critical', 'top secret' ]
}
}));
trace(projects.find({
'tags': {
'$containsAny': [ 'critical', 'top secret' ]
}
}));
trace('End view test');
sep();
Oops, something went wrong.
ProTip! Use n and p to navigate between commits in a pull request.