title: Should I create an object of a class or static method to check if a db entry exists?
body: <p>I'm new to OOP design concepts and was wondering what the correct approach is for the following use case (I'm developing with JavaScript and Mongo but I think the question is a general one):  </p>
  
  <p>I have <code>User</code> as a collection/table and have wrapped the interaction with this user with a class. My idea is to abstract away the DB interaction from the main program. 
  There are cases where I need to check if a <code>user</code> already exists in the DB:</p>
  
  <p>If it does: use the information of this user.<br>
  If it doesn't: cary on with the flow and redirect the user to some page</p>
  
  <ul>
  <li>Option 1: Does it make sense to create an instance of the User class just to check if it exists?</li>
  <li>Option 2: having something like a static method in the class to do this job, but also doesn't seem right since if the user exist I want to use it's info and I would need to create it again.</li>
  </ul>
  
  <p>Option 1:   </p>
  
  <pre><code>let user = new User(name);
  
  if (user.isExist()){
     //do something with user properties
  } else {
     //redirect to /someRoute
  }
  </code></pre>
  
  <p>Option 2:</p>
  
  <pre><code>if (User.isExist(name)){
    let user = new User(name);
    //do something with user properties
  } else {
     //redirect to /someRoute
  }
  </code></pre>