I want to make a server-side method that will allow me to check if a user already exists in db.users
, so I’ve made this:
Meteor.methods
userExists: (username) ->
check username, String
console.log Meteor.users.find({username: username}).fetch()
return { exists: true }
Obviously this is just a straight case-sensitive search. How do I look up a username regardless of case?