title: NeDB didn't update the records
body: <p>Hi I don't know why this function didn't do anything, even don't show anything on the console, and the callback function didn't work , Sorry if I made an obvious mistake I'm new with node js and NeDb.</p>
  
  <p>here is my update function:</p>
  
  <pre><code>var Datastore = require('nedb'),
      db = {
          games: new Datastore({filename: './backend/data/games.db', autoload: true})
      };
  
  var models = { 
       games : {
                update: function (query, update, options, callback) {
                             db.games.update(query, update, options,callback)
               }
              }
             }
  module.exports = models;
  </code></pre>
  
  <p>and I called with:</p>
  
  <pre><code>var models = require('./models');
  
  models.games.update({_id = game_id}, {$set: {fen: game.fen(), pgn: game.pgn()}}, {}, function(err,numDocs,docs){
        if (err){
           console.log(err);
        } else {
           console.log(numDocs);
           console.log(docs);
        }
      });
  </code></pre>
  
  <p>mi database looks like:</p>
  
  <pre><code>{"_id":"Egw17uRnAd5sdaKXVlOfxRQ6zr4VnSvFghiXkXHyCi9oiDMqDS","startpos":"rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1","fen":"rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1","pgn":"","w_id":"","b_id":""}
  {"_id":"6ZlTTQgk2hEhorTGeTV45kkRsUvrxfmROiCJMqLRQoTnvabhqK","startpos":"rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1","fen":"rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1","pgn":"","w_id":"","b_id":""} 
  </code></pre>
  
  <p>and the variables for the query</p>
  
  <pre><code>game_id = '6ZlTTQgk2hEhorTGeTV45kkRsUvrxfmROiCJMqLRQoTnvabhqK'
  game.pgn() = '1. e4 e5 2. Nf3'
  game.fen() = 'rnbqkbnr/pppp1ppp/8/4p3/4P3/5N2/PPPP1PPP/RNBQKB1R b KQkq - 1 2'
  </code></pre>
  
  <p><strong>UPDATE 1</strong></p>
  
  <p>if I put all the code together ,not in separated module, works perfectly </p>
  
  <pre><code>var Datastore = require('nedb'),
      db = {
            games: new Datastore({filename: './backend/data/games.db', autoload: true})
            };
  db.games.update({_id : game_id}, {$set: {fen: game.fen(), pgn: game.pgn()}}, {}, function(err,numDocs,docs){
     if (err){
         console.log(err);
     } else {
         console.log(numDocs);
         console.log(docs);
     }
  });
  </code></pre>
  
  <p>maybe is something with been working in separated module</p>
  
  <p><strong>UPDATE 2</strong> for simplicity </p>
  
  <p>The models.js file</p>
  
  <pre><code>    var Datastore = require('nedb'),
          db = {
              games: new Datastore({filename: 'database.db', autoload: true})
          };
  
  
      var models = {
          games: {
              create: function (id, startpos, fen, pgn, w_id, b_id, callback) {
                  db.games.insert({_id: id, startpos: startpos, fen: fen, pgn: pgn, w_id: w_id, b_id: b_id}, callback);
              },
              update: function (query, update, options, callback) {
                  db.games.update(query, update, options, callback)
              }
          }
      };
  
      module.exports = models;
  </code></pre>
  
  <p>the runupdate.js file</p>
  
  <pre><code>    var models = require('./models');
  
      models.games.create('6ZlTTQgk2hEhorTGeTV45kkRsUvrxfmROiCJMqLRQoTnvabhqK', 'rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1', 'rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1', '', '', '');
  
      models.games.update({_id: '6ZlTTQgk2hEhorTGeTV45kkRsUvrxfmROiCJMqLRQoTnvabhqK'}, {$set: {fen: 'r1bqk1nr/pppp1ppp/2n5/2b1p3/2B1P3/5N2/PPPP1PPP/RNBQ1RK1 b kq - 5 4', pgn: '1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. O-O'}}, {}, function(err,numDocs,docs){
          if (err){
              console.log(err);
          } else {
              console.log(numDocs);
          }
      });
  </code></pre>