Skip to Content
Flask By Example
book

Flask By Example

by Gareth Dwyer
March 2016
Intermediate to advanced
276 pages
6h 48m
English
Packt Publishing
Content preview from Flask By Example

Adding some finishing touches

To end off, we'll add a couple of indices to our database to improve efficiency and prevent multiple requests from being open for a single table. After this, we'll add a favicon to personalize our web application.

Adding indices to MongoDB

Database indices are used to increase efficiency. Normally, to find a subset of documents in our database that match certain criteria (that is, whenever we use the MongoDB find() method), the database engine has to examine each record and add the ones that match the returned result. If we add an index to a specific field, the database will store more metadata, which can be thought about as storing a sorted copy of this field. To find out whether john@example.com appears in a sorted ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Mastering Flask

Mastering Flask

Jack Stouffer
Flask Blueprints

Flask Blueprints

Joel Perras

Publisher Resources

ISBN: 9781785286933Supplemental Content