Ecosyste.ms: Packages

An open API service providing package, version and dependency metadata of many open source software ecosystems and registries.

Top 6.1% on proxy.golang.org
Top 4.8% dependent repos on proxy.golang.org
Top 4.8% forks on proxy.golang.org

proxy.golang.org : github.com/icza/minquery

Package minquery provides a mgo-like Query type called MinQuery, which supports efficient query pagination (cursors to continue listing documents where we left off). Let's say we have a users collection in MongoDB modeled with this Go struct: To query users having country=USA, sorted by Name and ID: And that's all. newCursor is the cursor to be used to fetch the next batch. Note #1: When calling MinQuery.All(), you have to provide the names of the cursor fields, this will be used to build the cursor data (and ultimately the cursor string) from. Note #2: If you're retrieving partial results (by using MinQuery.Select()), you have to include all the fields that are part of the cursor (the index entry) even if you don't intend to use them directly, else MinQuery.All() will not have all the values of the cursor fields, and so it will not be able to create the proper cursor value.

Registry - Source - Documentation - JSON
purl: pkg:golang/github.com/icza/minquery
Keywords: cursor, mgo, mongodb, pagination, query
License: Apache-2.0
Latest release: almost 6 years ago
First release: over 7 years ago
Namespace: github.com/icza
Dependent repositories: 1
Stars: 60 on GitHub
Forks: 21 on GitHub
See more repository details: repos.ecosyste.ms
Funding links: https://github.com/sponsors/icza
Last synced: about 1 month ago

    Loading...
    Readme
    Loading...