title: Synchronous mongoose request
body: <p>Is it possible to process a <code>db.model.find()</code> query inside of function context and retrieve a result <strong>without</strong> using <strong>callbacks and promises</strong> with mongoose library?</p>
  
  <p>I need to get assured, if some user exists in process of running controller, so, I can't minimize current scope to callback due to large amount of same operations (for example, communication with database). Also I'm trying to realize MVC model in my project, so, I want to keep the helper libs (modules) in separated files. That's why I don't want to use any callbacks or promises - they will much times complicate everything even more then things already do. 
  <hr>
  For example, how should I rewrite the following code to be executed successfully (if it's actually possible) (you can ignore <em>login model and controller</em> - they are written to represent complicacy if to rewrite that code using callbacks):</p>
  
  <p><strong>user.js lib</strong></p>
  
  <pre><code>var db = require('./lib/db');
  
  class User{
      constructor(id){ //get user by id
          var result = db.models.user.findOne({_id: id}); //unsupported syntax in real :(
          if(!result || result._id != _id)
              return false;
          else{
              this.userInfo = result;
  
              return result;
          }
  
      }
  }
  
  module.exports = User;
  </code></pre>
  
  <p><strong>login model</strong></p>
  
  <pre><code>var user = require('./lib/user')
  var model = {};
  
  model.checkUserLogged(function(req){
      if(!req.user.id || req.user.id == undefined)
          return false;
  
      if(!(this.user = new user(req.user.id)))
          return false;
      else
          return true;
  });
  
  module.exports = model;
  </code></pre>
  
  <p><strong>login controller</strong></p>
  
  <pre><code>var proxy = require('express').router();
  
  proxy.all('/login', function(req, res){
  
      var model = require('./models/login');
  
      if(!model.checkUserLogged()){
          console.log('User is not logged in!');
          res.render('unlogged', model);
      }else{
          console.log('User exists in database!');
          res.render('logged_in', model);
      }
  
  });
  </code></pre>
  
  <p>Generator functions/yields, async/await (<em>es2017</em>), and everything et cetera can be used just to solve the problem without nesting.</p>
  
  <p>Thx in advance.</p>