Recordsets support some additional operations. We can check whether a record is included or not in a recordset. If x is a singleton recordset and my_recordset is a recordset containing many records, we can use the following:
- x in my_recordset
- x not in my_recordset
The following operations are also available:
- recordset.ids returns the list with the IDs of the recordset elements.
- recordset.ensure_one() checks whether it's a single record (singleton); if it's not, a ValueError exception is raised.
- recordset.filtered(func) returns a filtered recordset, and func can be a function or a dot-separated expression representing a path of fields to follow, as shown in the examples that follow.
- recordset.mapped(func) returns a ...