Tablename_fieldname Copy code to clipboard This copies the contents of the source into the recipient (not the OREF of the collection itself). To copy the items in one collection into another collection, set the recipient collection equal to the source collection. Copy link to this section Copying Collection Data
Note that the details are not the same as for the list classes. For details, see the class reference for these classes. These classes provide instance methods such as GetAt(), Find(), GetPrevious(), GetNext(), and Remove(). %Collection.ArrayOfObj (if the array element is an object class) %Collection.ArrayOfDT (if the array element is a data type class) When you create an array property as described earlier, the property itself is an object that provides the instance methods of one of the following classes, depending on the property definition: Copy link to this section Working with Array Properties SetAt ( "yellow", 2 ) Copy code to clipboardįor other methods, such as Find(), RemoveAt(), and others, see the class reference for %Collection.ListOfDT and %Collection.ListOfObj. To define a list property, add a property as follows:ĭo person.
Copy link to this section Defining Collection Properties Note that collection classes are object classes. This chapter focuses on %Collection classes, but the details are similar for the %Library classes. InterSystems IRIS provides a different set of collection classes for use when you need a stand-alone collection, for example, to pass as an argument to a method these are classes in the %Library package.Įach set of classes provides methods and properties that you can use to add collection items, remove collection items, count collection items, and so on. InterSystems IRIS uses a set of collection classes as an interface to collection properties these are classes in the %Collection package. For arrays, keys can have arbitrary values, and you specify them for each element. For list collections, the system generates sequential integer keys. There are two kinds of collections: lists and arrays.Įach item in a collection is called an element and its position within the collection is called a key. This chapter describes collections, especially collection properties.Īlso see the chapters “ Defining and Using Literal Properties,” “ Working with Streams,” “ Defining and Using Object-Valued Properties,” “ Defining and Using Relationships”, and “ Using and Overriding Property Methods.” Copy link to this section Introduction to CollectionsĪ collection contains a set of individual elements, all of the same type. You can also define stand-alone collections for other purposes, such as for use as an method argument or return value. You can define collection properties in any object class. The elements can be literal values or can be objects. InterSystems IRIS® supports collections, which provide a way to work with a set of elements, all of the same type. Creating and Using Stand-Alone Collections.Controlling the SQL Projection of Collection Properties.