title: When to save a mongoose model
body: <p>This is an architectural question. I have models like this:</p>
  
  <pre><code>var foo = new mongoose.Schema({
    name: String,
    bars: [{type: ObjectId, ref: 'Bar'}]
  });
  var FooModel = mongoose.model('Foo', foo);
  
  var bar = new mongoose.Schema({
    foobar: String
  });
  var BarModel = mongoose.model('Bar', bar);
  </code></pre>
  
  <p>Then I want to implement a convenience method like this:</p>
  
  <pre><code>BarModel.methods.addFoo = function(foo) {
    foo.bars = foo.bars || []; // Side note, is this something I should check here?
    foo.bars.push(this.id);
  
    // Here's the line I'm wondering about... Should I include the line below?
    foo.save();
  }
  </code></pre>
  
  <p>The biggest con I see about this is that if I did include <code>foo.save()</code> then I should pass in a callback to <code>addFoo</code> so I avoid issues with the async operation. I'm thinking this is not preferable. But I also think it would be nice to include because <code>addFoo</code> hasn't really "addedFoo" until it's been saved... Am I breaking any design best practices doing it either way?</p>