var user = db.users[match[1]]; // won't ever find anything match[1] is a string (e.g. 'tobi') and db.users is an array of objects (like {name:'tobi'}). Possible work around (as user objects may have other properties):