timshannon / badgerhold

BadgerHold is an embeddable NoSQL store for querying Go types built on Badger
MIT License
519 stars 51 forks source link

Skip() and Limit() without Where clause #64

Closed kajjagtenberg closed 3 years ago

kajjagtenberg commented 3 years ago

Is there a way to get all records of a type and specifying a Skip and a Limit on the query, without having to specify a Where clause?

Or maybe it is possible to add an All() query which keeps all records elligible for retrieval?

Thanks in advance.

timshannon commented 3 years ago

Any empty query matches against all records:

q := &badgerhold.Query{}

err := store.Find(&result, q.Skip(10).Limit(50))
kajjagtenberg commented 3 years ago

Thanks!