How to use the feathers-mongoose.Service function in feathers-mongoose

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 phoomparin / FlipED / src / services / comments.js View on Github external
export default function comments() {
  this.use(COMMENT, new Service({
    Model: comment,
    paginate: {
      default: 15,
      max: 25
    }
  }))

  this.service(COMMENT).before({
    all: [],
    find: [viewRole],
    get: [viewRole],
    create: [modifyRole],
    update: [modifyRole],
    patch: [modifyRole]
  })
}
github phoomparin / FlipED / src / services / track.js View on Github external
export default function tracks() {
  this.use(TRACK, new Service({
    Model: track,
    paginate: {
      default: 5,
      max: 25
    }
  }))

  this.service(TRACK).before({
    all: [],
    find: [isRole("teacher")],
    get: [isRole("teacher")],
    create: [isRole("student")],
    remove: [isRole("teacher")],
    update: [isRole("teacher")],
    patch: [isRole("teacher")]
  })
github phoomparin / FlipED / src / services / assignments.js View on Github external
export default function assignments() {
  this.use(ASSIGNMENT, new Service({
    Model: assignment,
    paginate: {
      default: 15,
      max: 25
    }
  }))

  this.service(ASSIGNMENT).before({
    all: [],
    find: [viewRole],
    get: [viewRole],
    create: [modifyRole],
    update: [modifyRole],
    patch: [modifyRole]
  })
}
github phoomparin / FlipED / src / services / quizzes.js View on Github external
export default function quizzes() {
  this.use(QUIZ, new Service({
    Model: quiz,
    paginate: {
      default: 15,
      max: 25
    }
  }))

  this.service(QUIZ).before({
    all: [],
    find: [viewRole],
    get: [viewRole],
    create: [modifyRole],
    update: [modifyRole],
    patch: [modifyRole]
  })
}
github axi-platform / legacy / api / src / services / messages.js View on Github external
export default function messages() {
  this.use(MESSAGE, new Service({
    Model: message,
    paginate: {
      default: 5,
      max: 25
    }
  }))

  this.service(MESSAGE).before(standardPerms)
}
github phoomparin / FlipED / src / services / users.js View on Github external
export default function users() {
  this.use(USER, new Service({
    Model: user,
    paginate: {
      default: 100,
      max: 200
    }
  }))

  this.service(USER).before({
    find: [isRole(VIEW_USERS)],
    get: [isRole(VIEW_USERS)],
    create: [isRole(MODIFY_USERS), local.hooks.hashPassword()],
    remove: [isRole(MODIFY_USERS), local.hooks.hashPassword()],
    update: [isRole(MODIFY_USERS), local.hooks.hashPassword()],
    patch: [isRole(MODIFY_USERS), local.hooks.hashPassword()]
  })
github phoomparin / FlipED / src / services / messages.js View on Github external
export default function messages() {
  this.use(MESSAGE, new Service({
    Model: message,
    paginate: {
      default: 5,
      max: 25
    }
  }))

  this.service(MESSAGE).before({
    all: [],
    find: [viewRole],
    get: [viewRole],
    create: [modifyRole],
    update: [modifyRole],
    patch: [modifyRole]
  })
}
github phoomparin / FlipED / src / services / classes.js View on Github external
export default function courses() {
  this.use(CLASS, new Service({
    Model: classModel,
    paginate: {
      default: 15,
      max: 25
    }
  }))

  this.use("students", new StudentService())

  this.service(CLASS).before(standardPerms)
}

feathers-mongoose

A Feathers service adapter for the Mongoose ORM

MIT
Latest version published 2 years ago

Package Health Score

57 / 100
Full package analysis

Popular feathers-mongoose functions