Last active
August 29, 2015 14:08
-
-
Save sjcotto/08bc8a1edb44cbe37b30 to your computer and use it in GitHub Desktop.
kona
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var model = kona.model.open('employee'); | |
var find = function(req) { | |
var name = req.params.get("name"); | |
var find = [ | |
{ | |
first : { | |
$regex : ".*" + name + ".*", | |
$options: 'i' | |
} | |
}, | |
{ | |
last : { | |
$regex : ".*" + name + ".*", | |
$options: 'i' | |
} | |
} | |
]; | |
var obj = { | |
$or : find | |
} | |
return model.buildQuery().find(toJson(obj)).list(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment