How can I check if data in a collection exists. I need to ensure that usernames are unqiue. Any ideas?
The easiest way is to just put a unique index on the data that you need to be unique. If you try and insert new data with the same value, Mongo will return an error. At that point you can handle the error however you want.
You can read more about unique indexes at http://www.mongodb.org/display/DOCS/Indexes#Indexes-unique%3Atrue. You create them like any other index using the Node driver.
// everyone's username must be unique:
db.createIndex(userCollection, {username:1}, {unique:true});