How to use the monk.id function in monk

To help you get started, we’ve selected a few monk 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 desmosinc / desmos-sample-cms / routes / lessons.js View on Github external
router.get('/api/:id', function(req, res) {
  var db = req.db;
  var collection = db.get('lessons');
  var objID = monk.id(req.params.id);
  collection.findOne({_id: objID})
    .then(function(doc) {
      res.send(doc);
    })
    .catch(function(err) {
      res.send(err);
    });
});
github DemocracyOS / notifier / lib / jobs / lib / comment-reply.js View on Github external
agenda.define(jobName, (job, done) => {
    const { topic, comment, reply, url } = job.attrs.data

    comments.distinct('replies.author', {
      _id: monk.id(comment.id)
    }).then((usersToNotify) => {
      usersToNotify.push(monk.id(comment.author.id))

      return users.find({
        $and: [
          {
            _id: { $in: usersToNotify },
            'notifications.replies': true
          },
          { _id: { $ne: monk.id(reply.author.id) } }
        ]
      }).each((user, { pause, resume }) => {
        pause()

        agenda.now(jobNameForSingleUser, {
          topicTitle: topic.mediaTitle,
github DemocracyOS / notifier / lib / jobs / lib / comment-reply.js View on Github external
}).then((usersToNotify) => {
      usersToNotify.push(monk.id(comment.author.id))

      return users.find({
        $and: [
          {
            _id: { $in: usersToNotify },
            'notifications.replies': true
          },
          { _id: { $ne: monk.id(reply.author.id) } }
        ]
      }).each((user, { pause, resume }) => {
        pause()

        agenda.now(jobNameForSingleUser, {
          topicTitle: topic.mediaTitle,
          comment,
          reply,

monk

The wise MongoDB API

MIT
Latest version published 4 years ago

Package Health Score

54 / 100
Full package analysis