Subsections
Non Terminal Atom Production
The other atoms - sets, bags, arrays,
lists and structs - are non terminal
atoms. This means that they cannot be generated using a simple lexical
construct.
List, Set, Bag and Array Atoms
To construct a collection atom - list, set, bag
or array -, one may use the
function collection() where collection denotes the
collection type, for instance:
set(1, 2, 3)
list(1, "hello", "world")
array(2, 3, list(3893, -2, 'a'), 22)
bag(2, 2, 3, 4, 5, 12)
This is the simple way to construct such atoms, but as any other atoms,
a collection atom may be produced by the OQL interpreter as the evaluation
of a complex expression, for instance:
select x from Person x
produces an atom bag of objects.
Struct Atom
The most direct way to construct a struct atom is as follows:
struct({identifier:expr})
For instance:
struct(a: 1)
struct(format: text, s: "this is the text")
struct(name: "john", age: 32, spouse: first(select Person))
EyeDB manual