 
   # @param {*) obj
   # @returns {Boolean} Whether the given object is a collection.
-  isCollection: (obj) -> 
+  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

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



  forEachFieldSchema: (arg, callback) ->
    schema = Collections.getSchema(arg)
    unless schema
      throw new Error('Could not determine schema from: ' + arg)
    fieldIds = schema._schemaKeys
    for fieldId in fieldIds
      fieldSchema = schema.schema(fieldId)
