lib/model.js
function Model(collectionName, attributes, values) {
    this.collectionName = collectionName;
    this.idAttribute = Model.getId(attributes);
    this.attributes = attributeValidator.validate(attributes);
    this.values = { };
    this.virtuals = { };

    // initially add the null value from all attributes
    for (var key in this.attributes) {
        this.values[key] = undefined;
    }

    // prevents from modifying values and adding properties
    Object.freeze(this.attributes);

    // prevents from adding new properties
    Object.seal(this.values);

    // sets the initial values
    this.set(values);
}
function Model(collectionName, attributes, values) {
    this.collectionName = collectionName;
    this.idAttribute = Model.getId(attributes);
    this.attributes = attributeValidator.validate(attributes);
    this.values = { };
    this.virtuals = { };

    // initially add the null value from all attributes
    for (var key in this.attributes) {
        this.values[key] = undefined;
    }

    // prevents from modifying values and adding properties
    Object.freeze(this.attributes);

    // prevents from adding new properties
    Object.seal(this.values);

    // sets the initial values
    this.set(values);
}
function Model ( collectionName , attributes , values ) { this . collectionName = collectionName ; this . idAttribute = Model . getId ( attributes ) ; this . attributes = attributeValidator . validate ( attributes ) ; this . values = { } ; this . virtuals = { } ; // initially add the null value from all attributes for ( var key in this . attributes ) { this . values [ key ] = undefined ; } // prevents from modifying values and adding properties Object . freeze ( this . attributes ) ; // prevents from adding new properties Object . seal ( this . values ) ; // sets the initial values this . set ( values ) ; }
An entity is a lightweight persistence domain object.

@param {String} collectionName
@param {Object} attributes
@param {Object} values
@returns {Model}
An entity is a lightweight persistence domain object .