You'll need to fix the formatting of your answer as right now it looks like this returns the number of documents in a library because you're missing a some spaces in the markdown. (When I edit the post I see you're performing a query based on a supplied file name, and I can't save my edit of four spaces).
–
shuflerJul 4 '12 at 20:56

yes, i am returning the count. So i check that if the count is more than 0, that implies that the document exists.
–
AJ ManiaJul 5 '12 at 10:21