The Manager
We have already seen how to initialize the manager
, now, let's have a quick look at what it has to offer.
The all function
This function returns a list of all records present in the table. It takes an optional lock parameter that, if true, indicates that records that are going to be retrieved should have a lock put on them.
The count function
This function allows you to get the number of records that are present in the table. It can take an optional anonymous object as a parameter in order to filter records. By doing this, you can, for example, pass this object {sex : "M"}
if you want to get only records corresponding to a male person.
The delete function
The delete
function allows you to delete objects. Just like the count
function, it can take an anonymous object to filter records that will be concerned.
The get function
The get
function is certainly one of the most important functions; it allows you to retrieve an object from the database based on its Primary Key. It can also get...