     @forEachFieldSchema Collections.getSchema(arg), (field, fieldId) ->
       fields[fieldId] = field
     fields
-
-


  # @param {*) obj
  # @returns {Boolean} Whether the given object is a collection.
  isCollection: (obj) -> 
    FsCollection = FS?.Collection
    obj instanceof Meteor.Collection || obj instanceof Mongo.Collection ||
    # Packages may wrap the collection classes causing instanceof checks to fail, so we check the

      return if options?.validate == false
      context = {userId: userId, options: options, action: 'insert'}
      @_handleValidationResult validate.call context, doc

    collection.before.update (userId, doc, fieldNames, modifier, options) =>
      return if options?.validate == false
      doc = @simulateModifierUpdate(doc, modifier)
