How to use feathers-mongoose - 10 common examples

To help you get started, we’ve selected a few feathers-mongoose examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github feathers-plus / generator-feathers-plus / test-expands / ts-cumulative-1-mongoose.test-expected / src1 / services / nedb-1 / nedb-1.service.ts View on Github external
let moduleExports = function (app: App) {
  let Model = createModel(app);
  let paginate = app.get('paginate');
  // !code: func_init // !end

  let options = {
    Model,
    paginate,
    // !code: options_more // !end
  };
  // !code: options_change // !end

  // Initialize our service with any options it requires
  // ! code: extend
  app.use('/nedb-1', createService(options));
  // !end

  // Get our initialized service so that we can register hooks
  const service = app.service('nedb-1');

  service.hooks(hooks);
  // !code: func_return // !end
};
github feathers-plus / generator-feathers-plus / test / ts-cumulative-1-mongoose.test-expected / src1 / services / users-1 / users-1.service.ts View on Github external
let moduleExports = function (app: App) {
  let Model = createModel(app);
  let paginate = app.get('paginate');
  // !code: func_init // !end

  let options = {
    Model,
    paginate,
    // !code: options_more // !end
  };
  // !code: options_change // !end

  // Initialize our service with any options it requires
  app.use('/users-1', createService(options));

  // Get our initialized service so that we can register hooks
  const service = app.service('users-1');

  service.hooks(hooks);
  // !code: func_return // !end
};
github feathers-plus / generator-feathers-plus / test-expands / ts-cumulative-1-mongoose.test-expected / src1 / services / nedb-2 / nedb-2.service.ts View on Github external
let moduleExports = function (app: App) {
  let Model = createModel(app);
  let paginate = app.get('paginate');
  // !code: func_init // !end

  let options = {
    Model,
    paginate,
    // !code: options_more // !end
  };
  // !code: options_change // !end

  // Initialize our service with any options it requires
  // ! code: extend
  app.use('/nedb-2', createService(options));
  // !end

  // Get our initialized service so that we can register hooks
  const service = app.service('nedb-2');

  service.hooks(hooks);
  // !code: func_return // !end
};
github feathers-plus / generator-feathers-plus / test / ts-cumulative-1-mongoose.test-expected / src1 / services / nedb-2 / nedb-2.service.ts View on Github external
let moduleExports = function (app: App) {
  let Model = createModel(app);
  let paginate = app.get('paginate');
  // !code: func_init // !end

  let options = {
    Model,
    paginate,
    // !code: options_more // !end
  };
  // !code: options_change // !end

  // Initialize our service with any options it requires
  app.use('/nedb-2', createService(options));

  // Get our initialized service so that we can register hooks
  const service = app.service('nedb-2');

  service.hooks(hooks);
  // !code: func_return // !end
};
github feathers-plus / generator-feathers-plus / test-expands / ts-cumulative-1-mongoose.test-expected / src1 / services / users-1 / users-1.service.ts View on Github external
let moduleExports = function (app: App) {
  let Model = createModel(app);
  let paginate = app.get('paginate');
  // !code: func_init // !end

  let options = {
    Model,
    paginate,
    // !code: options_more // !end
  };
  // !code: options_change // !end

  // Initialize our service with any options it requires
  // ! code: extend
  app.use('/users-1', createService(options));
  // !end

  // Get our initialized service so that we can register hooks
  const service = app.service('users-1');

  service.hooks(hooks);
  // !code: func_return // !end
};
github feathersjs / generator-feathers / app / templates / services / mongoose-user.js View on Github external
export default function(){
  const app = this;
  
  mongoose.connect(app.get('mongodb'));

  let options = {
    Model: User,
    paginate: {
      default: 5,
      max: 25
    }
  };

  app.use('/v1/users', service(options));

  // const service = this.service('v1/users');

  /* * * Before hooks * * */
  // service.before({
  //   all:   [hooks.requireAuthForPrivate()],
  //   before: [hooks.setUserID()]
  // });

  // /* * * After hooks * * */
  // service.after({
  //   all: [hooks.removeSomeField()]
  // });

  // /* * * Set up event filters * * */
  // service.created = service.updated = service.patched = service.removed = events.requireAuthForPrivate;
github feathers-plus / generator-feathers-plus / examples / ts / 06-service / feathers-app / src / services / teams / teams.service.ts View on Github external
let moduleExports = function (app: App) {
  let Model = createModel(app);
  let paginate = app.get('paginate');
  // !code: func_init // !end

  let options = {
    Model,
    paginate,
    // !code: options_more // !end
  };
  // !code: options_change // !end

  // Initialize our service with any options it requires
  app.use('/teams', createService(options));

  // Get our initialized service so that we can register hooks
  const service = app.service('teams');

  service.hooks(hooks);
  // !code: func_return // !end
};
github feathers-plus / generator-feathers-plus / examples / ts / 06-service / feathers-app / src / services / roles / roles.service.ts View on Github external
let moduleExports = function (app: App) {
  let Model = createModel(app);
  let paginate = app.get('paginate');
  // !code: func_init // !end

  let options = {
    Model,
    paginate,
    // !code: options_more // !end
  };
  // !code: options_change // !end

  // Initialize our service with any options it requires
  app.use('/roles', createService(options));

  // Get our initialized service so that we can register hooks
  const service = app.service('roles');

  service.hooks(hooks);
  // !code: func_return // !end
};
github feathers-plus / generator-feathers-plus / examples / ts / 03-authentication / feathers-app / src / services / users / users.service.ts View on Github external
let moduleExports = function (app: App) {
  let Model = createModel(app);
  let paginate = app.get('paginate');
  // !code: func_init // !end

  let options = {
    Model,
    paginate,
    // !code: options_more // !end
  };
  // !code: options_change // !end

  // Initialize our service with any options it requires
  app.use('/users', createService(options));

  // Get our initialized service so that we can register hooks
  const service = app.service('users');

  service.hooks(hooks);
  // !code: func_return // !end
};
github feathers-plus / generator-feathers-plus / examples / ts / 07-fakes / feathers-app / src / services / roles / roles.service.ts View on Github external
let moduleExports = function (app: App) {
  let Model = createModel(app);
  let paginate = app.get('paginate');
  // !code: func_init // !end

  let options = {
    Model,
    paginate,
    // !code: options_more // !end
  };
  // !code: options_change // !end

  // Initialize our service with any options it requires
  app.use('/roles', createService(options));

  // Get our initialized service so that we can register hooks
  const service = app.service('roles');

  service.hooks(hooks);
  // !code: func_return // !end
};

feathers-mongoose

A Feathers service adapter for the Mongoose ORM

MIT
Latest version published 3 years ago

Package Health Score

57 / 100
Full package analysis

Popular feathers-mongoose functions