Complex Objects

 

A Complex object contains other objects or arrays.

 

For example:

 

    public class BasicUser

    {

        public Location HomeLocation;

 

        public Location CurrentLocation;

 

        public string Name;

 

        public DateTime BirthDate;

 

        public string Interests;

 

        public BasicUser[] Friends;

 

        public WorkPlace UserWorkPlace;

 

        public School UserSchool;

 

        public string[] Emails;

    }

 

 

To access the field during the query, you should write it after the ‘.’

 

For example, to access a field in BasicUser, a complex object would use:

 

var res = db.ExecuteQuery("SELECT BasicUser WHERE School.Name = 'Thornlegh School'");

 

In this query, a search is performed in the database for any BasicUser that has School with the name ‘Thornleigh School.’

 

You can also access other fields, as follows:

 

var res = db.ExecuteQuery("SELECT BasicUser WHERE Interests = 'reading'");