Added hasId method to document to check if id is set or not