title: ReferenceError: value is not defined
body: <p>I'm new to Node.js and have problem with a function. This function works fine if i put him in the same file. But if i call it from another file, it does not work. When i use debugger, i see that I can call the function but when i use the parameter, it keeps saying ReferenceError: value is not defined.</p>
  
  <pre><code>documentDBConfig.getById = function (feedId) {
      return new Promise((resolve, reject) =&gt; {
          client.queryDocuments(
              feedCollectionUrl,               
              'SELECT * FROM feeds r where r.id =' + feedId.toString()
          ).toArray((err, results) =&gt; {
              if (err) reject(err);
              else {
                  if (typeof results[0] !== 'undefined' &amp;&amp; results[0] !== null) {
                      documentDBConfig.feedsArray = results;
                  }
                  console.log();
                  resolve(results);
              }
          });
      });
  };
  
  module.exports = documentDBConfig;
  </code></pre>
  
  <p>Just because it keeps saying that, i used a property of a same object too <code>documentDBConfig.feedsId</code>. But it keeps still saying <code>ReferenceError: value is not defined</code>. In the debugger it sees the value and assign to <code>documentDBConfig.feedsId</code> without a problem but does not pass to another file. And without the value works this function fine. How can i fix that?</p>
  
  <pre><code>documentDBConfig.feedsId = req.params.id;
  console.log(documentDBConfig.feedsId);
      documentDBConfig.getById(documentDBConfig.feedsId)
          .then(() =&gt; res.json(documentDBConfig.feedsArray));
  </code></pre>
  
  <p>Edit: I found that the problem is caused by the query <code>'SELECT * FROM feeds r where r.id =' + feedId.toString()</code> If i write it hardcoded forexample <code>'SELECT * FROM rss r where r.id = "5"'</code> It works fine. I know documentdb accepts only strings for an id value, therefore i used toString() method. Is there any another solution for that?</p>