How to use the mingo.remove function in mingo

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

github serby / save / lib / memory-engine.js View on Github external
checkForIdAndData(object, function(error, foundObject) {
      if (error) {
        return callback(error)
      }

      if (overwrite) {
        updatedObject = Object.assign({}, object)
      } else {
        updatedObject = Object.assign({}, foundObject, object)
      }

      var query = {}
      var copy = Object.assign({}, updatedObject)
      query[options.idProperty] = id
      data = Mingo.remove(data, query)
      data.push(updatedObject)
      self.emit('afterUpdate', copy, overwrite)
      callback(undefined, copy)
    })
  }
github serby / save / lib / memory-engine.js View on Github external
function deleteMany(query, callback) {
    callback = callback || emptyFn
    self.emit('deleteMany', query)
    data = Mingo.remove(data, query)
    self.emit('afterDeleteMany', query)
    callback()
  }

mingo

MongoDB query language for in-memory objects

MIT
Latest version published 2 months ago

Package Health Score

83 / 100
Full package analysis

Similar packages