Collection
is returned. This allows you to iterate over your values and has a lot of shorthand methods.len()
standard python method can also be used.forget
does not return a new modified collection; it modifies the collection it is called on.for_page(page, count)
takes the page number and the number of items to show per page.,
or the given glue string.True
if the collection is empty; otherwise, False
is returned:merge
does not return a new modified collection; it modifies the collection it is called on.keep_nulls=False
to remove None
value in the collection.random
method to specify how many items you would like to randomly retrieve from the collection. A collection will always be returned when the items count is specifiedValueError
will be raised.0
by default but can be overridden:True
for any items to remove from the resulting collection:reject
does not return a new modified collection; it modifies the collection it is called on.reverse
does not return a new modified collection; it modifies the collection it is called on.serialize
also converts all of its nested objects. If you want to get the underlying items as is, use the all method instead.