🚀 Welcome to MDriven Learn –  MDriven is now on Discord!  Don’t miss the latest Release Notes.
OCLOperators size
Created by Alexandra on 2017-08-13 · Last edited by Vale.buyondo on 2026-02-11.

size () : Integer

The size() operator is used to determine the number of elements within a collection or a single object. In the MDriven/EAL environment, it is designed to be "null-safe" and adaptive to the input type.

Syntax and Return Value

  • Syntax: collection->size or object.size
  • Return Type: Integer
  • Requirement: If the operand is not already a list, it is implicitly converted to a list containing that single element before the count is performed

Example

Customer.allinstances->first.Orders->size()

Customer.allinstances Retrieves a collection of all objects of the type Customer in the system.

->firstPicks the very first Customer object from that collection.

.OrdersFollows the association from that specific Customer to their collection of Order objects.

->size()The Operator: Counts how many Order objects belong to that specific Customer.