Client-Side Data Storage by Raymond Camden
Author:Raymond Camden
Language: eng
Format: epub
Publisher: O'Reilly Media, Inc.
Published: 2016-01-10T16:00:00+00:00
Working with Ranges and Indexes
The cursor example you saw previously is useful for printing all the data, but typically you will want to work only with a subset of your data. This is where indexes come in. Indexes are based on a property of your data. Within that data, you can request a range of data.
So imagine an object store of people with an index on name. You could request a range of data based on names that begin with B and upward. (C, D, and so on.) You could instead request a range that begins at the “lowest” value for a name and goes up to T. Finally, you could request a range between R and S.
And to make things even more complex, for all of the preceding examples you can switch between an inclusive and exclusive mode. What does that mean? Imagine a range between B and E. An inclusive range will include B and E itself, giving you names like Barry and Elric. An exclusive range will give you values between B and E but not including names starting with those letters. So the first result may be Corwin. (And yes, numerical ranges work too.)
Finally, you can also create a “range” of one value, so, for example, just names that begin with R (like Raymond).
Working with ranges is only slightly different than cursors. Instead of opening a cursor on an object store, you open it on an index instead. As an example:
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
ActiveX | ASP.NET |
Cold Fusion | CSS |
DHTML | Java Server Pages |
JavaScript | PHP |
Python | Ruby |
XSL |
Hello! Python by Anthony Briggs(9918)
The Mikado Method by Ola Ellnestam Daniel Brolund(9780)
Dependency Injection in .NET by Mark Seemann(9342)
Sass and Compass in Action by Wynn Netherland Nathan Weizenbaum Chris Eppstein Brandon Mathis(7784)
The Well-Grounded Java Developer by Benjamin J. Evans Martijn Verburg(7560)
Svelte with Test-Driven Development by Daniel Irvine(7195)
Test-Driven Development with PHP 8 by Rainier Sarabia(6925)
Layered Design for Ruby on Rails Applications by Dementyev Vladimir;(6789)
Secrets of the JavaScript Ninja by John Resig & Bear Bibeault(6537)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(6420)
Web Development with Django by Ben Shaw Saurabh Badhwar(6251)
React Application Architecture for Production by Alan Alickovic(5976)
Jquery UI in Action : Master the concepts Of Jquery UI: A Step By Step Approach by ANMOL GOYAL(5809)
Kotlin in Action by Dmitry Jemerov(5068)
Audition by Ryu Murakami(4584)
Software Architecture for Web Developers by Mihaela Roxana Ghidersa(4470)
Hands-On Full-Stack Web Development with GraphQL and React by Sebastian Grebe(4320)
Accelerating Server-Side Development with Fastify by Manuel Spigolon Maksim Sinik & Matteo Collina(4316)
Functional Programming in JavaScript by Mantyla Dan(4040)
