Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion blitzdb/backends/file/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class Backend(BaseBackend):
Uses flat files to store objects on the hard disk and file-based indexes to
optimize querying.

:param path: The path to the database. If non-existant it will be created
:param path: The path to the database. If non-existent it will be created
:param config:
The configuration dictionary. If not specified, Blitz will try to load
it from disk. If this fails, the default configuration will be used
Expand Down
2 changes: 1 addition & 1 deletion blitzdb/backends/file/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def sort_keys(self, keys, order=QuerySet.ASCENDING):

:param keys: Keys to be sorted
:type keys: list(str)
:param order: Order criteri (asending or descending)
:param order: Order criteri (ascending or descending)
:type order: int
:return: Sorted keys
:rtype: list(str)
Expand Down
4 changes: 2 additions & 2 deletions blitzdb/backends/sql/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -946,7 +946,7 @@ def resolve_include(include,collection,d,path = None):
raise AttributeError("Included field '{}' is not a related object!".format(main_include))
#if we ask for github_data and github_data.full_name is an index field, we
#need to fetch both the `data` field and the github_data_full_name index field.
#by adding the . we make sure that we won't inlcude e.g. committer_date
#by adding the . we make sure that we won't include e.g. committer_date
#if committer_date_ts is asked for.
for key,params in self._index_fields[collection].items():
if key == main_include:
Expand Down Expand Up @@ -977,7 +977,7 @@ def resolve_include(include,collection,d,path = None):
else:
include['lazy'] = False

#we add the order_by_keys seperately
#we add the order_by_keys separately
#(these should not influence whether a document is fetched lazily or not)
for order_by_key in order_by_keys:
resolve_include(order_by_key,collection,include_params)
Expand Down
2 changes: 1 addition & 1 deletion docs/source/backends/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Currently, Blitz comes with two preinstalled backends:
MongoDB <mongo>


* :doc:`Native Backend <file>` The **native backend**, which we sometimes refer to as the **file-based backend** uses a file-based index and flat files to store objects in a local directory. It has not any external dependencies and is usually sufficent for most low- to mid-end applications.
* :doc:`Native Backend <file>` The **native backend**, which we sometimes refer to as the **file-based backend** uses a file-based index and flat files to store objects in a local directory. It has not any external dependencies and is usually sufficient for most low- to mid-end applications.

* :doc:`MongoDB Backend <mongo>` The **MongoDB backend** uses `PyMongo <http://api.mongodb.org/python/2.7rc0/>`_ to store and retrieve documents from a MongoDB database. It can be used in high-end applications, where use of a professional database engine is advocated.

10 changes: 5 additions & 5 deletions docs/source/tutorials/basics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ In addition, since Blitz is a **transactional database**, we have to call the :p

.. note::

Use the :py:meth:`Backend.begin <blitzdb.backends.file.Backend.begin>` function to start a new database transaction and the :py:meth:`Backend.rollback <blitzdb.backends.file.Backend.rollback>` function to roll back the state of the database to the beginning of a transaction, if needed. By default, Blitz uses a **local isolation level** for transactions, so changes you make to the state of the database will be visible to parts of your program using the same backend, but will only be written to disk when :py:meth:`Backend.commit <blitzdb.backends.file.Backend.commit>` is invoked. If you like autocommits set the :py:meth:`Backend.autocomit <blitzdb.backends.file.Backend.autocommit>` to True after instantiating the backend
Use the :py:meth:`Backend.begin <blitzdb.backends.file.Backend.begin>` function to start a new database transaction and the :py:meth:`Backend.rollback <blitzdb.backends.file.Backend.rollback>` function to roll back the state of the database to the beginning of a transaction, if needed. By default, Blitz uses a **local isolation level** for transactions, so changes you make to the state of the database will be visible to parts of your program using the same backend, but will only be written to disk when :py:meth:`Backend.commit <blitzdb.backends.file.Backend.commit>` is invoked. If you like autocommits set the :py:meth:`Backend.autocommit <blitzdb.backends.file.Backend.autocommit>` to True after instantiating the backend

Retrieving Documents
--------------------
Expand Down Expand Up @@ -228,10 +228,10 @@ Like MongoDB, Blitz supports advanced query operators, which you can include in

* **$and** : Performs a boolean **AND** on two or more expressions
* **$or** : Performs a boolean **OR** on two or more expressions
* **$gt** : Performs a **>** comparision between an attribute and a specified value
* **$gte** : Performs a **>=** comparision between an attribute and a specified value
* **$lt** : Performs a **<** comparision between an attribute and a specified value
* **$lte** : Performs a **<=** comparision between an attribute and a specified value
* **$gt** : Performs a **>** comparison between an attribute and a specified value
* **$gte** : Performs a **>=** comparison between an attribute and a specified value
* **$lt** : Performs a **<** comparison between an attribute and a specified value
* **$lte** : Performs a **<=** comparison between an attribute and a specified value
* **$all** : Returns documents containing all values in the argument list.
* **$in** : Returns documents matching at least one of the values in the argument list.
* **$ne** : Performs a **not equal** operation on the given expression
Expand Down
2 changes: 1 addition & 1 deletion tests/test_sorting.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def test_basic_sorting(backend):
backend.commit()
actors = list(backend.filter(Actor, {}).sort([('birth_year', 1)]))
assert actor_wo_birth_year in actors
#SQL backends can produce ambigous results depending on how NULLS FIRST is implemented
#SQL backends can produce ambiguous results depending on how NULLS FIRST is implemented
#this varies e.g. between Postgres and SQLite (which does not even support NULLS FIRST)
if not isinstance(backend,SqlBackend):
assert actors[0] == actor_wo_birth_year