exports._project = function(api, next){

  var mongoose = require('mongoose');

  var uri = process.env.MONGOLAB_URI
      || 'mongodb://localhost/forest';


  var orgSchema = {
      name: String,
      printers: [ mongoose.Schema.Types.ObjectId ],
      users: [ mongoose.Schema.Types.ObjectId ],
      public: Boolean
  };

  var printerSchema = {
      name: String,
      location: String,
      ipAddress: String,
      statuses: [ {
        timeStamp: Date,
        status: String,
        pageCount: Number,
        tonerLevel: Number
      } ],
      manufacturer: String,
      model: String
  };

  var userSchema = {
      name: String,
      email: String,
      password: String,
      admin: Boolean
  };

  var appSchema = {
      name: String,
      description: String,
      user: mongoose.Schema.Types.ObjectId,
      key: String
  }

  mongoose.connect(uri);

  mongoose.model('Organization', orgSchema);
  mongoose.model('Printer', printerSchema);
  mongoose.model('User', userSchema);
  mongoose.model('App', appSchema);

  api.mongoose = mongoose;

  next();
};

exports._project = function(api, next){

  var mongoose = require('mongoose');

  var uri = process.env.MONGOLAB_URI
      || 'mongodb://localhost/forest';


  var orgSchema = {
      name: String,
      printers: [ mongoose.Schema.Types.ObjectId ],
      users: [ mongoose.Schema.Types.ObjectId ],
      public: Boolean
  };

  var printerSchema = {
      name: String,
      location: String,
      ipAddress: String,
      statuses: [ {
        timeStamp: Date,
        status: String,
        pageCount: Number,
        tonerLevel: Number
      } ],
      manufacturer: String,
      model: String
  };

  var userSchema = {
      name: String,
      email: String,
      password: String,
      admin: Boolean
  };

  var appSchema = {
      name: String,
      description: String,
      user: mongoose.Schema.Types.ObjectId,
      key: String
  }

  mongoose.connect(uri);

  mongoose.model('Organization', orgSchema);
  mongoose.model('Printer', printerSchema);
  mongoose.model('User', userSchema);
  mongoose.model('App', appSchema);

  api.mongoose = mongoose;
  api.ObjectId = mongoose.Types.ObjectId;

  next();
};

Add ObjectId to api for more concise code
Add ObjectId to api for more concise code
