diff --git a/cassandra/cqlengine/query.py b/cassandra/cqlengine/query.py index 6c2a2a25..4b2230c9 100644 --- a/cassandra/cqlengine/query.py +++ b/cassandra/cqlengine/query.py @@ -753,14 +753,19 @@ class AbstractQuerySet(object): def limit(self, v): """ - Limits the number of results returned by Cassandra. + Limits the number of results returned by Cassandra. Use *0* or *None* to disable. *Note that CQL's default limit is 10,000, so all queries without a limit set explicitly will have an implicit limit of 10,000* .. code-block:: python + # Fetch 100 users for user in User.objects().limit(100): print(user) + + # Fetch all users + for user in User.objects().limit(None): + print(user) """ if v is None: @@ -782,7 +787,7 @@ class AbstractQuerySet(object): """ Sets the number of rows that are fetched at a time. - *Note that driver's default fetch size is 5000. + *Note that driver's default fetch size is 5000.* .. code-block:: python diff --git a/docs/api/cassandra/cqlengine/query.rst b/docs/api/cassandra/cqlengine/query.rst index 62119e39..ad5489f2 100644 --- a/docs/api/cassandra/cqlengine/query.rst +++ b/docs/api/cassandra/cqlengine/query.rst @@ -32,6 +32,8 @@ The methods here are used to filter, order, and constrain results. .. automethod:: limit + .. automethod:: fetch_size + .. automethod:: if_not_exists .. automethod:: if_exists