js/data/Model.js
function (field) {
            var schemaDefinition = this.schema[field];
            if (!schemaDefinition) {
                throw "Couldn't find '" + field + "' in schema";
            }
            var collection = this.get(field);
            if (!collection) {
                var context = this.getContextForChild(schemaDefinition.type);
                if (context) {
                    collection = context.createCollection(schemaDefinition.type, null);
                    collection.$parent = this;
                    this.set(field, collection);
                } else {
                    throw "Couldn't determine context for " + field;
                }
            }
            return collection;


        }
function (field) {
            var schemaDefinition = this.schema[field];
            if (!schemaDefinition) {
                throw "Couldn't find '" + field + "' in schema";
            }
            var collection = this.get(field);
            if (!collection) {
                var context = this.getContextForChild(schemaDefinition.type);
                if (context) {
                    collection = context.createCollection(schemaDefinition.type, null);
                    collection.$parent = this;
                    this.set(field, collection);
                } else {
                    throw "Couldn't determine context for " + field;
                }
            }
            return collection;


        }
function ( field ) { var schemaDefinition = this . schema [ field ] ; if ( ! schemaDefinition ) { throw "Couldn't find '" + field + "' in schema" ; } var collection = this . get ( field ) ; if ( ! collection ) { var context = this . getContextForChild ( schemaDefinition . type ) ; if ( context ) { collection = context . createCollection ( schemaDefinition . type , null ) ; collection . $parent = this ; this . set ( field , collection ) ; } else { throw "Couldn't determine context for " + field ; } } return collection ; }
Returns a sub collection of the model for a given field.
If the collection doesn't exist it gets created.
You should always use this method to get a sub collection.

@param {String} field
@returns {js.data.Collection}
Returns a sub collection of the model for a given field . If the collection doesn t exist it gets created . You should always use this method to get a sub collection .