Code coverage report for api/datum/DocumentCollection.js

Statements: 100% (10 / 10)      Branches: 100% (2 / 2)      Functions: 100% (2 / 2)      Lines: 100% (10 / 10)      Ignored: none     

All files » api/datum/ » DocumentCollection.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 411 1                       1 585 581   585 585     1                         4326         1  
var Collection = require("./../Collection").Collection;
var FieldDBObject = require("./../FieldDBObject").FieldDBObject;
 
/**
 * @class Collection of CouchDB docs
 
 * @name  DocumentCollection
 * @description The DocumentCollection is a minimal customization of the Collection
 * to add an internal model of Document and prevent the primary key from being sanitized
 *
 * @extends Collection
 * @constructs
 */
var DocumentCollection = function DocumentCollection(options) {
  if (!this._fieldDBtype) {
    this._fieldDBtype = "DocumentCollection";
  }
  this.debug("Constructing DocumentCollection ", options);
  Collection.apply(this, arguments);
};
 
DocumentCollection.prototype = Object.create(Collection.prototype, /** @lends DocumentCollection.prototype */ {
  constructor: {
    value: DocumentCollection
  },
 
  INTERNAL_MODELS: {
    value: {
      item: FieldDBObject
    }
  },
 
  sanitizeStringForPrimaryKey: {
    value: function(value) {
      return value;
    }
  }
 
});
exports.DocumentCollection = DocumentCollection;