Merge pull request #1862 from bagerard/document_name_param_for_indexes
Documented that it is possible to specify a 'name' for the indexes (using the dict definition)
This commit is contained in:
		| @@ -513,6 +513,9 @@ If a dictionary is passed then the following options are available: | |||||||
|     Allows you to automatically expire data from a collection by setting the |     Allows you to automatically expire data from a collection by setting the | ||||||
|     time in seconds to expire the a field. |     time in seconds to expire the a field. | ||||||
|  |  | ||||||
|  | :attr:`name` (Optional) | ||||||
|  |     Allows you to specify a name for the index | ||||||
|  |  | ||||||
| .. note:: | .. note:: | ||||||
|  |  | ||||||
|     Inheritance adds extra fields indices see: :ref:`document-inheritance`. |     Inheritance adds extra fields indices see: :ref:`document-inheritance`. | ||||||
|   | |||||||
| @@ -214,7 +214,7 @@ class query_counter(object): | |||||||
|         """Get the number of queries.""" |         """Get the number of queries.""" | ||||||
|         ignore_query = {'ns': {'$ne': '%s.system.indexes' % self.db.name}} |         ignore_query = {'ns': {'$ne': '%s.system.indexes' % self.db.name}} | ||||||
|         count = self.db.system.profile.find(ignore_query).count() - self.counter |         count = self.db.system.profile.find(ignore_query).count() - self.counter | ||||||
|         self.counter += 1 |         self.counter += 1       # Account for the query we just fired | ||||||
|         return count |         return count | ||||||
|  |  | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user